Вход Регистрация
Файл: upload/core/vendor/twig/twig/src/Node/BlockReferenceNode.php
Строк: 42
<?php

/*
 * This file is part of Twig.
 *
 * (c) Fabien Potencier
 * (c) Armin Ronacher
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace TwigNode;

use 
TwigAttributeYieldReady;
use 
TwigCompiler;

/**
 * Represents a block call node.
 *
 * @author Fabien Potencier <fabien@symfony.com>
 */
#[YieldReady]
class BlockReferenceNode extends Node implements NodeOutputInterface
{
    public function 
__construct(string $nameint $lineno)
    {
        
parent::__construct([], ['name' => $name], $lineno);
    }

    public function 
compile(Compiler $compiler): void
    
{
        
$compiler
            
->addDebugInfo($this)
            ->
write(sprintf("yield from $this->unwrap()->yieldBlock('%s', $context$blocks);n"$this->getAttribute('name')))
        ;
    }
}
Онлайн: 0
Реклама