mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-14 11:27:00 +00:00
fixed template cloning problem with inheritance
This commit is contained in:
@@ -78,15 +78,16 @@ class Twig_Node_Module extends Twig_Node
|
||||
;
|
||||
} else {
|
||||
$compiler
|
||||
->write("\$this->parent = ")
|
||||
->write("\$parent = ")
|
||||
->subcompile($this->parent)
|
||||
->raw(";\n")
|
||||
->write("if (!\$this->parent")
|
||||
->write("if (!\$parent")
|
||||
->raw(" instanceof Twig_Template) {\n")
|
||||
->indent()
|
||||
->write("\$this->parent = clone \$this->env->loadTemplate(\$this->parent);\n")
|
||||
->write("\$parent = \$this->env->loadTemplate(\$parent);\n")
|
||||
->outdent()
|
||||
->write("}\n")
|
||||
->write("\$this->parent = clone \$parent;\n")
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
@@ -124,10 +124,11 @@ class __TwigTemplate_be925a7b06dda0dfdbd18a1509f7eb34 extends Twig_Template
|
||||
public function display(array \$context)
|
||||
{
|
||||
if (null === \$this->parent) {
|
||||
\$this->parent = (true) ? ("foo") : ("foo");
|
||||
if (!\$this->parent instanceof Twig_Template) {
|
||||
\$this->parent = clone \$this->env->loadTemplate(\$this->parent);
|
||||
\$parent = (true) ? ("foo") : ("foo");
|
||||
if (!\$parent instanceof Twig_Template) {
|
||||
\$parent = \$this->env->loadTemplate(\$parent);
|
||||
}
|
||||
\$this->parent = clone \$parent;
|
||||
\$this->parent->pushBlocks(\$this->blocks);
|
||||
}
|
||||
\$this->parent->display(\$context);
|
||||
|
||||
Reference in New Issue
Block a user