This commit is contained in:
parent
72826ea815
commit
bf101b3b26
@ -94,20 +94,14 @@ class Page
|
|||||||
function renderPagecontent()
|
function renderPagecontent()
|
||||||
{
|
{
|
||||||
$controller_dir = ROOT . DS . 'pages' . DS . $this->_controller . DS;
|
$controller_dir = ROOT . DS . 'pages' . DS . $this->_controller . DS;
|
||||||
/*$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');
|
|
||||||
$m = new Mustache_Engine(array(
|
|
||||||
'entity_flags' => ENT_QUOTES,
|
|
||||||
'partials_loader' => new Mustache_Loader_CascadingLoader($partials)
|
|
||||||
));
|
|
||||||
$this->variables['translate'] = function($value) { return translate($value); };
|
|
||||||
$m = $this->addHelpers($m);*/
|
|
||||||
|
|
||||||
|
//when the template path starts with a / it is relative to the root of the project
|
||||||
|
if($this->variables['template'][0]=='/')
|
||||||
|
$this->variables['template'] = '../../'.$this->variables['template'];
|
||||||
if($this->variables['template'] && file_exists(ROOT . DS . 'pages' . DS . $this->_controller . DS . $this->variables['template']))
|
if($this->variables['template'] && file_exists(ROOT . DS . 'pages' . DS . $this->_controller . DS . $this->variables['template']))
|
||||||
$templatefile = ROOT . DS . 'pages' . DS . $this->_controller . DS . $this->variables['template'];
|
$templatefile = ROOT . DS . 'pages' . DS . $this->_controller . DS . $this->variables['template'];
|
||||||
|
|
||||||
|
|
||||||
//render template by running include
|
//render template by running include
|
||||||
ob_start();
|
ob_start();
|
||||||
extract($this->variables);
|
extract($this->variables);
|
||||||
|
@ -9,9 +9,4 @@ class Login extends Page {
|
|||||||
//return print_r($_REQUEST, true);
|
//return print_r($_REQUEST, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
function maySeeThisPage()
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
@ -33,7 +33,7 @@
|
|||||||
<a href="#" hx-get="/features" hx-push-url="/features" hx-target="#main" class="text-sm font-semibold leading-6 text-gray-900">Features</a>
|
<a href="#" hx-get="/features" hx-push-url="/features" hx-target="#main" class="text-sm font-semibold leading-6 text-gray-900">Features</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="hidden lg:flex lg:flex-1 lg:justify-end">
|
<div class="hidden lg:flex lg:flex-1 lg:justify-end">
|
||||||
<a href="#" hx-get="/templates/login.html" hx-target="#main" hx-push-url="/login" class="text-sm font-semibold leading-6 text-gray-900">Log in <span aria-hidden="true">→</span></a>
|
<a href="#" hx-get="/login" hx-target="#main" hx-push-url="/login" class="text-sm font-semibold leading-6 text-gray-900">Log in <span aria-hidden="true">→</span></a>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
</header>
|
</header>
|
||||||
|
Reference in New Issue
Block a user