Skip to content

Commit

Permalink
fix twig 2.0 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
marcj committed Feb 2, 2017
1 parent 72eb8a6 commit 9a0258e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Twig/Node/Content.php
Expand Up @@ -25,8 +25,8 @@ public function __construct($name, $id, $type, $optional, $options, $line, $tag
$this->name = $name;

parent::__construct(
array('id' => $id, 'type' => $type, 'options' => $options),
array('optional' => filter_var($optional, FILTER_VALIDATE_BOOLEAN)),
array('id' => $id),
array('optional' => filter_var($optional, FILTER_VALIDATE_BOOLEAN), 'type' => $type, 'options' => $options),
$line,
$tag
);
Expand All @@ -45,14 +45,14 @@ public function compile(\Twig_Compiler $compiler)
->addDebugInfo($this)
->write("\$renderParams = [];\n");

if (null !== $type = $this->getNode('type')) {
if (null !== $type = $this->getAttribute('type')) {
$compiler
->write("\$renderParams['type'] = ")
->subcompile($type)
->write(";\n");
}

if (null !== $options = $this->getNode('options')) {
if (null !== $options = $this->getAttribute('options')) {
$compiler
->write("\$renderParams['options'] = ")
->subcompile($options)
Expand Down

0 comments on commit 9a0258e

Please sign in to comment.