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

Breadcrumb

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

function Parser::setBlock

File

vendor/twig/twig/src/Parser.php, line 259

Class

Parser
@author Fabien Potencier <fabien@symfony.com>

Namespace

Twig

Code

public function setBlock(string $name, BlockNode $value) : void {
    if (isset($this->blocks[$name])) {
        throw new SyntaxError(\sprintf("The block '%s' has already been defined line %d.", $name, $this->blocks[$name]
            ->getTemplateLine()), $this->getCurrentToken()
            ->getLine(), $this->blocks[$name]
            ->getSourceContext());
    }
    $this->blocks[$name] = new BodyNode([
        $value,
    ], [], $value->getTemplateLine());
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal