public function Twig_Environment::addNodeVisitor

Registers a Node Visitor.

Parameters

Twig_NodeVisitorInterface $visitor A Twig_NodeVisitorInterface instance:

1 call to Twig_Environment::addNodeVisitor()
Twig_Environment::getNodeVisitors in drupal/core/vendor/twig/twig/lib/Twig/Environment.php
Gets the registered Node Visitors.

File

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

Class

Twig_Environment
Stores the Twig configuration.

Code

public function addNodeVisitor(Twig_NodeVisitorInterface $visitor) {
  $this->staging['visitors'][] = $visitor;
  $this->visitors = null;
}