Moved grav variable into globals and removed from template variables

This commit is contained in:
Andy Miller
2015-10-25 16:49:28 -06:00
parent 79f6380aae
commit 95fd54d909
2 changed files with 12 additions and 1 deletions

View File

@@ -142,7 +142,6 @@ class Twig
// Set some standard variables for twig
$this->twig_vars = array(
'grav' => $this->grav,
'config' => $config,
'uri' => $this->grav['uri'],
'base_dir' => rtrim(ROOT_DIR, '/'),

View File

@@ -36,6 +36,18 @@ class TwigExtension extends \Twig_Extension
return 'GravTwigExtension';
}
/**
* Register some standard globals
*
* @return array
*/
public function getGlobals()
{
return array(
'grav' => $this->grav,
);
}
/**
* Return a list of all filters.
*