| Conditions | 1 |
| Paths | 1 |
| Total Lines | 22 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 10 | public function compile(Compiler $compiler): void |
||
| 11 | { |
||
| 12 | $name = $this->getAttribute('name'); |
||
| 13 | |||
| 14 | $compiler |
||
| 15 | ->write("public function block_$name(\$context, array \$blocks = [])\n", "{\n") |
||
| 16 | ->indent() |
||
| 17 | ->write("\$this->env->getExtension('".DeferredExtension::class."')->defer(\$this, '$name');\n") |
||
| 18 | ->outdent() |
||
| 19 | ->write("}\n\n") |
||
| 20 | ; |
||
| 21 | |||
| 22 | $compiler |
||
| 23 | ->addDebugInfo($this) |
||
| 24 | ->write("public function block_{$name}_deferred(\$context, array \$blocks = [])\n", "{\n") |
||
| 25 | ->indent() |
||
| 26 | ->subcompile($this->getNode('body')) |
||
| 27 | ->write("\$this->env->getExtension('".DeferredExtension::class."')->resolve(\$this, \$context, \$blocks);\n") |
||
| 28 | ->outdent() |
||
| 29 | ->write("}\n\n") |
||
| 30 | ; |
||
| 31 | } |
||
| 32 | } |
||
| 33 |