forked from leftypol/leftypol
upgrade twig library
This commit is contained in:
parent
01857d176a
commit
9c48084f3b
163 changed files with 275 additions and 94 deletions
36
inc/lib/Twig/Node/Module.php
Normal file → Executable file
36
inc/lib/Twig/Node/Module.php
Normal file → Executable file
|
@ -235,9 +235,41 @@ class Twig_Node_Module extends Twig_Node
|
|||
|
||||
$compiler
|
||||
->outdent()
|
||||
->write(");\n")
|
||||
->write(");\n\n")
|
||||
;
|
||||
|
||||
// macro information
|
||||
$compiler
|
||||
->write("\$this->macros = array(\n")
|
||||
->indent()
|
||||
;
|
||||
|
||||
foreach ($this->getNode('macros') as $name => $node) {
|
||||
$compiler
|
||||
->addIndentation()->repr($name)->raw(" => array(\n")
|
||||
->indent()
|
||||
->write("'method' => ")->repr($node->getAttribute('method'))->raw(",\n")
|
||||
->write("'arguments' => array(\n")
|
||||
->indent()
|
||||
;
|
||||
foreach ($node->getNode('arguments') as $argument => $value) {
|
||||
$compiler->addIndentation()->repr($argument)->raw (' => ')->subcompile($value)->raw(",\n");
|
||||
}
|
||||
$compiler
|
||||
->outdent()
|
||||
->write("),\n")
|
||||
->outdent()
|
||||
->write("),\n")
|
||||
;
|
||||
}
|
||||
$compiler
|
||||
->outdent()
|
||||
->write("}\n\n");
|
||||
->write(");\n")
|
||||
;
|
||||
|
||||
$compiler
|
||||
->outdent()
|
||||
->write("}\n\n")
|
||||
;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue