EmbedNode example

$module = $this->parser->parse($stream[$this, 'decideBlockEnd'], true);

        // override the parent with the correct one         if ($fakeParentToken === $parentToken) {
            $module->setNode('parent', $parent);
        }

        $this->parser->embedTemplate($module);

        $stream->expect(/* Token::BLOCK_END_TYPE */ 3);

        return new EmbedNode($module->getTemplateName()$module->getAttribute('index')$variables$only$ignoreMissing$token->getLine()$this->getTag());
    }

    public function decideBlockEnd(Token $token): bool
    {
        return $token->test('endembed');
    }

    public function getTag(): string
    {
        return 'embed';
    }
}
Home | Imprint | This part of the site doesn't use cookies.