Exemple #1
0
 protected function render($view, $controller = "site", $arrResult = array(), $template = TEMPLATE)
 {
     $cache = new CCache(604800);
     $flagCache = false;
     if (!$cache->cacheExists(CApp::getHashCurPage()) && false) {
         $flagCache = true;
         $cache->startCache();
     }
     include_once $_SERVER["DOCUMENT_ROOT"] . "/engine/templates/" . $template . "/header.php";
     include_once $_SERVER["DOCUMENT_ROOT"] . "/engine/templates/" . $template . "/views/" . strtolower($controller) . "/" . $view . ".php";
     include_once $_SERVER["DOCUMENT_ROOT"] . "/engine/templates/" . $template . "/footer.php";
     if ($flagCache) {
         $cache->writeCache(filterGetValue(CApp::getHashCurPage()));
     }
 }
Exemple #2
0
 protected function render($view, $controller = "site", $arrResult = [], $template = null)
 {
     if ($template == null) {
         $template = CApp::settings('APPLICATION')->templates['default'];
     }
     $cache = new CCache(604800);
     $flagCache = false;
     if (!$cache->cacheExists(CApp::getHashCurPage()) && CApp::settings("APPLICATION")->settings['cache_on']) {
         $flagCache = true;
         $cache->startCache();
     }
     include $_SERVER["DOCUMENT_ROOT"] . "/engine/templates/" . $template . "/header.php";
     include $_SERVER["DOCUMENT_ROOT"] . "/engine/templates/" . $template . "/views/" . strtolower($controller) . "/" . $view . ".php";
     include $_SERVER["DOCUMENT_ROOT"] . "/engine/templates/" . $template . "/footer.php";
     if ($flagCache) {
         $cache->writeCache(filterGetValue(CApp::getHashCurPage()));
     }
 }