for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Chris\Bundle\FrontRenderBundle\Listener;
class TwigListener
{
/**
* @var \Twig_Environment $twig
*/
protected $twig;
* @param \Twig_Environment $twig
public function __construct(\Twig_Environment $twig)
$this->twig = $twig;
}
* Update twig tags
public function updateTagTwig()
$lexer = $this->getLexer();
$this->twig->setLexer($lexer);
public function getLexer()
$lexer = new \Twig_Lexer($this->twig, [
'tag_comment' => ['{*', '*}'],
'tag_block' => ['{@', '@}'],
'tag_variable' => ['{$', '$}'],
]);
return $lexer;