mirror of
https://github.com/twigphp/Twig.git
synced 2026-10-13 23:35:49 +00:00
Merge branch '2.x' into 3.x
* 2.x: macros imported "globally" in a template are now available in macros without re-importing them added more tests added some tests
This commit is contained in:
@@ -160,7 +160,8 @@ final class ModuleNode extends Node
|
||||
->raw(" extends Template\n")
|
||||
->write("{\n")
|
||||
->indent()
|
||||
->write("private \$source;\n\n")
|
||||
->write("private \$source;\n")
|
||||
->write("private \$macros = [];\n\n")
|
||||
;
|
||||
}
|
||||
|
||||
@@ -304,6 +305,7 @@ final class ModuleNode extends Node
|
||||
$compiler
|
||||
->write("protected function doDisplay(array \$context, array \$blocks = [])\n", "{\n")
|
||||
->indent()
|
||||
->write("\$macros = \$this->macros;\n")
|
||||
->subcompile($this->getNode('display_start'))
|
||||
->subcompile($this->getNode('body'))
|
||||
;
|
||||
|
||||
Reference in New Issue
Block a user