Permalink
Browse files

Fixed TokenParser to allow optional target added view alias to the co…

…nfiguration.
  • Loading branch information...
1 parent fc709ba commit cae1eaa79201526af59282f222941019d5cfc429 @cosmin-harangus committed Apr 11, 2012
Showing with 6 additions and 4 deletions.
  1. +3 −0 config/module.config.php
  2. +1 −2 src/ZeTwig/View/Extension.php
  3. +2 −2 src/ZeTwig/View/Extension/Trigger/TokenParser.php
View
@@ -2,6 +2,9 @@
return array(
'di' => array(
'instance' => array(
+ 'alias'=>array(
+ 'view'=>'ZeTwig\View\Renderer'
+ ),
// Inject the plugin broker for controller plugins into
// the action controller for use by all controllers that
// extend it.
@@ -1,8 +1,7 @@
<?php
namespace ZeTwig\View;
-use
- Zend\Http\Response,
+use Zend\Http\Response,
Zend\Mvc\Controller\ActionController,
Zend\View\Model\ViewModel,
Zend\Loader\LocatorAware,
@@ -3,7 +3,7 @@
use Twig_TokenParser,
Twig_Token,
Twig_Node_Expression_Array,
- Twig_Node_Expression_AssignName;
+ Twig_Node_Expression_Constant;
class TokenParser extends Twig_TokenParser
{
@@ -23,7 +23,7 @@ function parse(Twig_Token $token)
$this->parser->getStream()->next();
$target = $this->parser->getExpressionParser()->parseExpression();
} else {
- $target = new Twig_Node_Expression_AssignName(null, $token->getLine());
+ $target = new Twig_Node_Expression_Constant(null, $token->getLine());
}
// attributes

0 comments on commit cae1eaa

Please sign in to comment.