| 1 | <?php |
||
| 8 | class LexerManager |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * @var Twig_Environment |
||
| 12 | */ |
||
| 13 | protected $twig; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * @var Twig_Lexer |
||
| 17 | */ |
||
| 18 | protected $defaultLexer; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * LexerManager constructor. |
||
| 22 | * |
||
| 23 | * @param Twig_Environment $twig |
||
| 24 | */ |
||
| 25 | 12 | public function __construct(Twig_Environment $twig) |
|
| 30 | |||
| 31 | /** |
||
| 32 | * Get DefaultLexer |
||
| 33 | * |
||
| 34 | * @return Twig_Lexer |
||
| 35 | */ |
||
| 36 | 2 | public function getDefaultLexer() |
|
| 40 | |||
| 41 | /** |
||
| 42 | * Set the custom twig lexer to display custom tags on the front |
||
| 43 | */ |
||
| 44 | 1 | public function updateLexer() |
|
| 48 | |||
| 49 | /** |
||
| 50 | * Rollback the lexer of twig |
||
| 51 | */ |
||
| 52 | 2 | public function rollbackLexer() |
|
| 56 | |||
| 57 | /** |
||
| 58 | * Retrieve the custom twig lexer for the front |
||
| 59 | * |
||
| 60 | * @return Twig_Lexer |
||
| 61 | */ |
||
| 62 | 9 | public function getNewLexer() |
|
| 72 | } |
||
| 73 |