public function Twig_Environment::addNodeVisitor

Registers a Node Visitor.

Parameters

Twig_NodeVisitorInterface $visitor A Twig_NodeVisitorInterface instance:

File

drupal/core/vendor/twig/twig/lib/Twig/Environment.php, line 728

Class

Twig_Environment
Stores the Twig configuration.

Code

public function addNodeVisitor(Twig_NodeVisitorInterface $visitor) {
  if ($this->extensionInitialized) {
    throw new LogicException('Unable to add a node visitor as extensions have already been initialized.', $extension
      ->getName());
  }
  $this->staging
    ->addNodeVisitor($visitor);
}