mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-12 02:16:41 +00:00
Fix usage of display_end hook
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# 3.9.2 (2024-XX-XX)
|
||||
|
||||
* n/a
|
||||
* Fix usage of display_end hook
|
||||
|
||||
# 3.9.1 (2024-04-17)
|
||||
|
||||
|
||||
@@ -336,12 +336,15 @@ final class ModuleNode extends Node
|
||||
$compiler->raw('$this->getParent($context)');
|
||||
}
|
||||
$compiler->raw("->unwrap()->yield(\$context, array_merge(\$this->blocks, \$blocks));\n");
|
||||
} else {
|
||||
}
|
||||
|
||||
$compiler->subcompile($this->getNode('display_end'));
|
||||
|
||||
if (!$this->hasNode('parent')) {
|
||||
$compiler->write("return; yield '';\n"); // ensure at least one yield call even for templates with no output
|
||||
}
|
||||
|
||||
$compiler
|
||||
->subcompile($this->getNode('display_end'))
|
||||
->outdent()
|
||||
->write("}\n\n")
|
||||
;
|
||||
|
||||
Reference in New Issue
Block a user