Skip to content

Commit

Permalink
Fix wrong class names (#12)
Browse files Browse the repository at this point in the history
Co-authored-by: Nikolas Evers <vintagesucks@users.noreply.github.com>
  • Loading branch information
lapiudevgit and vintagesucks committed Jan 28, 2023
1 parent 15386dd commit e4657de
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ETwigViewRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand All @@ -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;
Expand Down
6 changes: 6 additions & 0 deletions test/protected/config/twig.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
],
],
]
];

0 comments on commit e4657de

Please sign in to comment.