From e4657deb26be8c0c05f0e55e8881461f9b19c96a Mon Sep 17 00:00:00 2001 From: lapiudevgit <114943459+lapiudevgit@users.noreply.github.com> Date: Fri, 27 Jan 2023 22:13:04 -0300 Subject: [PATCH] Fix wrong class names (#12) Co-authored-by: Nikolas Evers --- ETwigViewRenderer.php | 6 +++--- test/protected/config/twig.php | 6 ++++++ 2 files changed, 9 insertions(+), 3 deletions(-) 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', + ], ], ] ];