IncludeNode example

$expr = $this->parser->getExpressionParser()->parseExpression();

        [$variables$only$ignoreMissing] = $this->parseArguments();

        // resolves parent template         if ($expr->hasAttribute('value')) {
            // set pointer to next value (contains the template file name)             $parent = $this->finder->find($expr->getAttribute('value')$ignoreMissing);

            $expr->setAttribute('value', $parent);

            return new IncludeNode($expr$variables$only$ignoreMissing$token->getLine()$this->getTag());
        }

        return new SwInclude($expr$variables$only$ignoreMissing$token->getLine()$this->getTag());
    }

    public function getTag(): string
    {
        return 'sw_include';
    }

    private function parseArguments(): array
    {
Home | Imprint | This part of the site doesn't use cookies.