diff --git a/ETwigViewRenderer.php b/ETwigViewRenderer.php index 1dadf4b..606f518 100644 --- a/ETwigViewRenderer.php +++ b/ETwigViewRenderer.php @@ -205,13 +205,13 @@ public function addExtensions($extensions) */ public function setLexerOptions($options) { - $lexer = new Twig_Lexer($this->_twig, $options); + $lexer = new Twig\Lexer($this->_twig, $options); $this->_twig->setLexer($lexer); } /** * Returns Twig object - * @return Twig_Environment + * @return Twig\Environment */ public function getTwig() { @@ -226,7 +226,7 @@ public function getTwig() */ private function _addCustom($classType, $elements) { - $classFunction = 'Twig_Simple' . $classType; + $classFunction = '\Twig\Twig' . $classType; foreach ($elements as $name => $func) { $twigElement = null; diff --git a/test/protected/config/twig.php b/test/protected/config/twig.php index 27b5d3f..ab91d7d 100644 --- a/test/protected/config/twig.php +++ b/test/protected/config/twig.php @@ -7,6 +7,12 @@ 'class' => 'root.vendor.vintagesucks.twig-renderer.ETwigViewRenderer', 'twigPathAlias' => 'root.vendor.twig.twig.lib.Twig', 'fileExtension' => '.twig', + 'lexerOptions' => [ + 'tag_comment' => ['{#', '#}'], + ], + 'functions' => [ + 'rot13' => 'str_rot13', + ], ], ] ];