first commit

This commit is contained in:
root
2020-02-19 16:42:35 +01:00
commit d668d90f82
2224 changed files with 334338 additions and 0 deletions

View File

@ -0,0 +1,29 @@
<?php
namespace Phive\Twig\Extensions\Deferred;
class DeferredBlockNode extends \Twig_Node_Block
{
public function compile(\Twig_Compiler $compiler)
{
$name = $this->getAttribute('name');
$compiler
->write("public function block_$name(\$context, array \$blocks = array())\n", "{\n")
->indent()
->write("\$this->env->getExtension('Phive\\Twig\\Extensions\\Deferred\\DeferredExtension')->defer(\$this, '$name');\n")
->outdent()
->write("}\n\n")
;
$compiler
->addDebugInfo($this)
->write("public function block_{$name}_deferred(\$context, array \$blocks = array())\n", "{\n")
->indent()
->subcompile($this->getNode('body'))
->write("\$this->env->getExtension('Phive\\Twig\\Extensions\\Deferred\\DeferredExtension')->resolve(\$this, \$context, \$blocks);\n")
->outdent()
->write("}\n\n")
;
}
}