mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-06 08:47:45 +02:00
Merge pull request #2859 from Nicofuma/ticket/12957
[ticket/12957] Update the constructions of the template engine
This commit is contained in:
@@ -13,9 +13,6 @@
|
||||
|
||||
namespace phpbb\template\twig;
|
||||
|
||||
use Twig_Lexer;
|
||||
use Twig_LexerInterface;
|
||||
|
||||
class environment extends \Twig_Environment
|
||||
{
|
||||
/** @var \phpbb\config\config */
|
||||
@@ -79,6 +76,7 @@ class environment extends \Twig_Environment
|
||||
if (null === $this->lexer)
|
||||
{
|
||||
$this->lexer = $this->container->get('template.twig.lexer');
|
||||
$this->lexer->set_environment($this);
|
||||
}
|
||||
|
||||
return $this->lexer;
|
||||
|
@@ -15,6 +15,11 @@ namespace phpbb\template\twig;
|
||||
|
||||
class lexer extends \Twig_Lexer
|
||||
{
|
||||
public function set_environment(\Twig_Environment $env)
|
||||
{
|
||||
$this->env = $env;
|
||||
}
|
||||
|
||||
public function tokenize($code, $filename = null)
|
||||
{
|
||||
// Our phpBB tags
|
||||
|
Reference in New Issue
Block a user