added check if template exists, and aff fallback to index.html
This commit is contained in:
parent
4e376b12fc
commit
a5e21c704c
1 changed files with 4 additions and 0 deletions
|
@ -100,6 +100,10 @@ class Pico {
|
|||
);
|
||||
$this->run_hooks('before_render', array(&$twig_vars, &$twig));
|
||||
$template = (isset($meta['template']) && strlen($meta['template']) > 0) ? $meta['template'] : 'index';
|
||||
if (!file_exists(THEMES_DIR . $settings['theme'] . "/{$template}.html")) {
|
||||
// fallback to index.html if template not exists...
|
||||
$template = 'index';
|
||||
}
|
||||
$output = $twig->render("{$template}.html", $twig_vars);
|
||||
$this->run_hooks('after_render', array(&$output));
|
||||
echo $output;
|
||||
|
|
Loading…
Add table
Reference in a new issue