|
|
|
@ -2098,7 +2098,9 @@ class Pico |
|
|
|
|
// this is the reason why we can't register this filter as part of PicoTwigExtension |
|
|
|
|
$pico = $this; |
|
|
|
|
$pages = &$this->pages; |
|
|
|
|
$this->twig->addFilter(new Twig_SimpleFilter('content', function ($page) use ($pico, &$pages) { |
|
|
|
|
$this->twig->addFilter(new Twig_SimpleFilter( |
|
|
|
|
'content', |
|
|
|
|
function ($page) use ($pico, &$pages) { |
|
|
|
|
if (isset($pages[$page])) { |
|
|
|
|
$pageData = &$pages[$page]; |
|
|
|
|
if (!isset($pageData['content'])) { |
|
|
|
@ -2108,7 +2110,9 @@ class Pico |
|
|
|
|
return $pageData['content']; |
|
|
|
|
} |
|
|
|
|
return null; |
|
|
|
|
})); |
|
|
|
|
}, |
|
|
|
|
array('is_safe' => array('html')) |
|
|
|
|
)); |
|
|
|
|
|
|
|
|
|
// trigger onTwigRegistration event |
|
|
|
|
$this->triggerEvent('onTwigRegistered', array(&$this->twig)); |
|
|
|
|