template fix and test
All checks were successful
Build and push / Pulling repo on server (push) Successful in 3s
All checks were successful
Build and push / Pulling repo on server (push) Successful in 3s
This commit is contained in:
@ -94,7 +94,7 @@ class Page
|
||||
function renderPagecontent()
|
||||
{
|
||||
$controller_dir = ROOT . DS . 'pages' . DS . $this->_controller . DS;
|
||||
$partials = [];
|
||||
/*$partials = [];
|
||||
if(is_dir($controller_dir.'partials'))
|
||||
$partials[] = new Mustache_Loader_FilesystemLoader($controller_dir.'partials');
|
||||
$partials[] = new Mustache_Loader_FilesystemLoader(ROOT.DS.DS.'templates'.DS.'partials');
|
||||
@ -102,18 +102,20 @@ class Page
|
||||
'entity_flags' => ENT_QUOTES,
|
||||
'partials_loader' => new Mustache_Loader_CascadingLoader($partials)
|
||||
));
|
||||
|
||||
$this->variables['translate'] = function($value) { return translate($value); };
|
||||
|
||||
$m = $this->addHelpers($m);
|
||||
$m = $this->addHelpers($m);*/
|
||||
|
||||
if($this->variables['template'] && file_exists(ROOT . DS . 'pages' . DS . $this->_controller . DS . $this->variables['template']))
|
||||
$template = file_get_contents(ROOT . DS . 'pages' . DS . $this->_controller . DS . $this->variables['template']);
|
||||
else
|
||||
$template = file_get_contents(ROOT . DS . 'views' . DS . 'defaultcontainer.mustache');
|
||||
|
||||
$templatefile = ROOT . DS . 'pages' . DS . $this->_controller . DS . $this->variables['template'];
|
||||
|
||||
$pagecontent = $m->render($template, $this->variables);
|
||||
//render template by running include
|
||||
ob_start();
|
||||
include($templatefile);
|
||||
$pagecontent = ob_get_contents();
|
||||
ob_end_clean();
|
||||
|
||||
|
||||
//$pagecontent = $m->render($template, $this->variables);
|
||||
|
||||
return $pagecontent;
|
||||
}
|
||||
|
Reference in New Issue
Block a user