mirror of
https://github.com/phpbb/phpbb.git
synced 2025-02-24 12:03:21 +01:00
[ticket/13762] Replace user service with lang in twig extension
PHPBB3-13762
This commit is contained in:
parent
9f1f6f96ce
commit
9a99c9e4b1
@ -33,7 +33,7 @@ services:
|
||||
class: phpbb\template\twig\extension
|
||||
arguments:
|
||||
- @template_context
|
||||
- @user
|
||||
- @language
|
||||
tags:
|
||||
- { name: twig.extension }
|
||||
|
||||
|
@ -18,20 +18,20 @@ class extension extends \Twig_Extension
|
||||
/** @var \phpbb\template\context */
|
||||
protected $context;
|
||||
|
||||
/** @var \phpbb\user */
|
||||
protected $user;
|
||||
/** @var \phpbb\language\language */
|
||||
protected $language;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param \phpbb\template\context $context
|
||||
* @param \phpbb\user $user
|
||||
* @param \phpbb\language\language $language
|
||||
* @return \phpbb\template\twig\extension
|
||||
*/
|
||||
public function __construct(\phpbb\template\context $context, $user)
|
||||
public function __construct(\phpbb\template\context $context, $language)
|
||||
{
|
||||
$this->context = $context;
|
||||
$this->user = $user;
|
||||
$this->language = $language;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -181,6 +181,6 @@ class extension extends \Twig_Extension
|
||||
// LA_ is transformed into lang(\'$1\')|escape('js'), so we should not
|
||||
// need to check for it
|
||||
|
||||
return call_user_func_array(array($this->user, 'lang'), $args);
|
||||
return call_user_func_array(array($this->language, 'lang'), $args);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user