From df5fb0516d53f9017f3f9ab105f3ec8172d862c0 Mon Sep 17 00:00:00 2001 From: igorhim Date: Tue, 18 Feb 2014 23:48:56 +0200 Subject: [PATCH 1/2] Fix custom modifier closure functions call --- src/Fenom/Template.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Fenom/Template.php b/src/Fenom/Template.php index fe6f025..8ff44e0 100644 --- a/src/Fenom/Template.php +++ b/src/Fenom/Template.php @@ -1173,6 +1173,7 @@ class Template extends Render if (!$mods) { throw new \Exception("Modifier " . $tokens->current() . " not found"); } + $modifier = $tokens->current(); $tokens->next(); $args = array(); @@ -1183,7 +1184,7 @@ class Template extends Render } if (!is_string($mods)) { // dynamic modifier - $mods = 'call_user_func($tpl->getStorage()->getModifier("' . $mods . '"), '; + $mods = 'call_user_func($tpl->getStorage()->getModifier("' . $modifier . '"), '; } else { $mods .= "("; } From 65477a5a06b32de25dd5bf7aa3a38583e09088d9 Mon Sep 17 00:00:00 2001 From: igorhim Date: Tue, 18 Feb 2014 23:53:02 +0200 Subject: [PATCH 2/2] Fix warning object to string --- src/Fenom/Template.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Fenom/Template.php b/src/Fenom/Template.php index 8ff44e0..0f2d524 100644 --- a/src/Fenom/Template.php +++ b/src/Fenom/Template.php @@ -492,11 +492,11 @@ class Template extends Render return $this->out($this->parseExpr($tokens), $tokens); } } catch (InvalidUsageException $e) { - throw new CompileException($e->getMessage() . " in {$this} line {$this->_line}", 0, E_ERROR, $this->_name, $this->_line, $e); + throw new CompileException($e->getMessage() . " in {$this->_name} line {$this->_line}", 0, E_ERROR, $this->_name, $this->_line, $e); } catch (\LogicException $e) { - throw new SecurityException($e->getMessage() . " in {$this} line {$this->_line}, near '{" . $tokens->getSnippetAsString(0, 0) . "' <- there", 0, E_ERROR, $this->_name, $this->_line, $e); + throw new SecurityException($e->getMessage() . " in {$this->_name} line {$this->_line}, near '{" . $tokens->getSnippetAsString(0, 0) . "' <- there", 0, E_ERROR, $this->_name, $this->_line, $e); } catch (\Exception $e) { - throw new CompileException($e->getMessage() . " in {$this} line {$this->_line}, near '{" . $tokens->getSnippetAsString(0, 0) . "' <- there", 0, E_ERROR, $this->_name, $this->_line, $e); + throw new CompileException($e->getMessage() . " in {$this->_name} line {$this->_line}, near '{" . $tokens->getSnippetAsString(0, 0) . "' <- there", 0, E_ERROR, $this->_name, $this->_line, $e); } }