Project

General

Profile

« Previous | Next » 

Revision 1938

Added by darkviper almost 11 years ago

update Twig template engine to version 1.13.1

View differences:

For.php
13 13
/**
14 14
 * Represents a for node.
15 15
 *
16
 * @package    twig
17
 * @author     Fabien Potencier <fabien@symfony.com>
16
 * @author Fabien Potencier <fabien@symfony.com>
18 17
 */
19 18
class Twig_Node_For extends Twig_Node
20 19
{
......
108 107
        $compiler->write('unset($context[\'_seq\'], $context[\'_iterated\'], $context[\''.$this->getNode('key_target')->getAttribute('name').'\'], $context[\''.$this->getNode('value_target')->getAttribute('name').'\'], $context[\'_parent\'], $context[\'loop\']);'."\n");
109 108

  
110 109
        // keep the values set in the inner context for variables defined in the outer context
111
        $compiler->write("\$context = array_merge(\$_parent, array_intersect_key(\$context, \$_parent));\n");
110
        $compiler->write("\$context = array_intersect_key(\$context, \$_parent) + \$_parent;\n");
112 111
    }
113 112
}

Also available in: Unified diff