mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
[ticket/15905] Re-add add_class and lang_defined
PHPBB3-15905
This commit is contained in:
parent
133dfd0a84
commit
f21003f977
1 changed files with 12 additions and 0 deletions
|
@ -89,6 +89,8 @@ class extension extends \Twig_Extension
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
new \Twig_SimpleFunction('lang', array($this, 'lang')),
|
new \Twig_SimpleFunction('lang', array($this, 'lang')),
|
||||||
|
new \Twig_SimpleFunction('lang_defined', array($this, 'lang_defined')),
|
||||||
|
new \Twig_SimpleFunction('get_class', 'get_class'),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -186,4 +188,14 @@ class extension extends \Twig_Extension
|
||||||
|
|
||||||
return call_user_func_array(array($this->language, 'lang'), $args);
|
return call_user_func_array(array($this->language, 'lang'), $args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a language variable exists
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function lang_defined($key)
|
||||||
|
{
|
||||||
|
return call_user_func_array([$this->language, 'is_set'], [$key]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue