container = $container; } public function getFunctions() { return array( 'global_var' => new \Twig_Function_Method($this, 'getGlobalVarValue'), 'get_var' => new \Twig_Function_Method($this, 'getGlobalVarValue'), ); } public function getGlobalVarValue($key, $default = null, $locale = null) { return $this->container->get('global_vars')->get($key, $default, $locale); } public function getName() { return 'global_var_extension'; } }