Goetas\Twital\Attribute\BlockInnerAttribute::visit PHP 메소드

visit() 공개 메소드

public visit ( DOMAttr $att, Compiler $context )
$att DOMAttr
$context Goetas\Twital\Compiler
    public function visit(\DOMAttr $att, Compiler $context)
    {
        $node = $att->ownerElement;
        $pi = $context->createControlNode("block " . $att->value);
        if ($node->firstChild) {
            $node->insertBefore($pi, $node->firstChild);
        } else {
            $node->appendChild($pi);
        }
        $pi = $context->createControlNode("endblock");
        $node->appendChild($pi);
        $node->removeAttributeNode($att);
    }
BlockInnerAttribute