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

Breadcrumb

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

function ExtensionSet::getTokenParser

File

vendor/twig/twig/src/ExtensionSet.php, line 291

Class

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

Namespace

Twig

Code

public function getTokenParser(string $name) : ?TokenParserInterface {
    if (!$this->initialized) {
        $this->initExtensions();
    }
    if (isset($this->parsers[$name])) {
        return $this->parsers[$name];
    }
    foreach ($this->parserCallbacks as $callback) {
        if (false !== ($parser = $callback($name))) {
            return $parser;
        }
    }
    return null;
}
RSS feed
Powered by Drupal