From 5c9c37888971ace2f79aa7b3c5ac0199272cfcce Mon Sep 17 00:00:00 2001 From: hwmaier Date: Tue, 27 Oct 2015 23:04:21 +1000 Subject: [PATCH] onTwigPageVariables event handler gets Page object passed --- system/src/Grav/Common/Twig/Twig.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/system/src/Grav/Common/Twig/Twig.php b/system/src/Grav/Common/Twig/Twig.php index c983a76f4..381efe56f 100644 --- a/system/src/Grav/Common/Twig/Twig.php +++ b/system/src/Grav/Common/Twig/Twig.php @@ -7,6 +7,7 @@ use Grav\Common\Page\Page; use Grav\Common\Inflector; use Grav\Common\Utils; use RocketTheme\Toolbox\ResourceLocator\UniformResourceLocator; +use RocketTheme\Toolbox\Event\Event; /** * The Twig object handles all the Twig template rendering for Grav. It's a singleton object @@ -201,7 +202,7 @@ class Twig $content = $content !== null ? $content : $item->content(); // override the twig header vars for local resolution - $this->grav->fireEvent('onTwigPageVariables'); + $this->grav->fireEvent('onTwigPageVariables', new Event(['page' => $item])); $twig_vars = $this->twig_vars; $twig_vars['page'] = $item;