Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. MethodCallExpression.php

function MethodCallExpression::compile

Overrides Node::compile

File

vendor/twig/twig/src/Node/Expression/MethodCallExpression.php, line 29

Class

MethodCallExpression

Namespace

Twig\Node\Expression

Code

public function compile(Compiler $compiler) : void {
    if ($this->getAttribute('is_defined_test')) {
        $compiler->raw('method_exists($macros[')
            ->repr($this->getNode('node')
            ->getAttribute('name'))
            ->raw('], ')
            ->repr($this->getAttribute('method'))
            ->raw(')');
        return;
    }
    $compiler->raw('CoreExtension::callMacro($macros[')
        ->repr($this->getNode('node')
        ->getAttribute('name'))
        ->raw('], ')
        ->repr($this->getAttribute('method'))
        ->raw(', ')
        ->subcompile($this->getNode('arguments'))
        ->raw(', ')
        ->repr($this->getTemplateLine())
        ->raw(', $context, $this->getSourceContext())');
}
RSS feed
Powered by Drupal