use Symfony\Component\Routing\RouterInterface;
use Twig\Error\Error;
-use Twig\Node\Expression\AssignNameExpression;
+use Twig\Node\Expression\Variable\AssignContextVariable;
use Twig\Node\Node;
+use Twig\Node\Nodes;
+use Twig\Node\EmptyNode;
use Twig\Node\SetNode;
use Twig\Node\TextNode;
use Twig\Source;
#throw new Error('Empty inputs token', $token->getLine(), $stream->getSourceContext());
//Send an empty node without inputs
- return new Node();
+ return new EmptyNode();
}
//Check filters
}
//Set name in context key
- $ref = new AssignNameExpression($this->token, $token->getLine());
+ $ref = new AssignContextVariable($this->token, $token->getLine());
//Set output in context value
$value = new TextNode($asset, $token->getLine());
//Send body with context set
- return new Node([
+ return new Nodes([
//This define name in twig template by prepending $context['<name>'] = '<output>';
new SetNode(true, $ref, $value, $token->getLine(), $this->getTag()),
//The tag captured body