embedTemplate example

$parentToken,
            new Token(/* Token::BLOCK_END_TYPE */ 3, '', $token->getLine()),
        ]);

        $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');
    }

    
Home | Imprint | This part of the site doesn't use cookies.