mirror of
https://github.com/twigphp/Twig.git
synced 2026-10-10 05:45:50 +00:00
Remove usage of ob_* functions in favor of yielding
This commit is contained in:
@@ -28,9 +28,16 @@ class BlockReferenceNode extends Node implements NodeOutputInterface
|
||||
|
||||
public function compile(Compiler $compiler): void
|
||||
{
|
||||
$compiler
|
||||
->addDebugInfo($this)
|
||||
->write(sprintf("\$this->displayBlock('%s', \$context, \$blocks);\n", $this->getAttribute('name')))
|
||||
;
|
||||
if ($compiler->getEnvironment()->useYield()) {
|
||||
$compiler
|
||||
->addDebugInfo($this)
|
||||
->write(sprintf("yield from \$this->unwrap()->yieldBlock('%s', \$context, \$blocks);\n", $this->getAttribute('name')))
|
||||
;
|
||||
} else {
|
||||
$compiler
|
||||
->addDebugInfo($this)
|
||||
->write(sprintf("\$this->displayBlock('%s', \$context, \$blocks);\n", $this->getAttribute('name')))
|
||||
;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user