Created
March 15, 2022 17:37
-
-
Save 0test/c942698004522948a427efc59e1f133e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace EvolutionCMS\Main\Controllers; | |
use Illuminate\Support\Facades\Cache; | |
class BaseController{ | |
public $data = []; | |
public function __construct() | |
{ | |
$this->evo = EvolutionCMS(); | |
ksort($_GET); | |
$cacheid = md5(json_encode($_GET)); | |
if ($this->evo->getConfig('enable_cache')) { | |
$this->data = Cache::rememberForever($cacheid, function () { | |
$this->render(); | |
$this->globalElements(); | |
return $this->data; | |
}); | |
} else { | |
$this->globalElements(); | |
$this->render(); | |
} | |
$this->noCacheRender(); | |
$this->sendToView(); | |
} | |
public function render() | |
{ | |
} | |
public function globalElements() | |
{ | |
$this->data['pages'] = 'pages'; | |
} | |
public function noCacheRender() | |
{ | |
} | |
public function sendToView() | |
{ | |
$this->evo->addDataToView($this->data); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment