Craft 3 Class Reference

Class craft\web\twig\nodevisitors\EventTagAdder

Inheritance
craft\web\twig\nodevisitors\EventTagAdder » craft\web\twig\nodevisitors\BaseEventTagVisitor
Implements
Twig_NodeVisitorInterface
Available since version
3.0
Source Code
https://github.com/craftcms/cms/blob/master/src/web/twig/nodevisitors/EventTagAdder.php

EventTagAdder adds missing head(), beginBody(), and endBody() event tags to templates as they’re being compiled.

Protected Properties
Property Type Description Defined By
$foundBeginBody boolean Whether the beginBody() tag has been found/added craft\web\twig\nodevisitors\BaseEventTagVisitor
$foundEndBody boolean Whether the endBody() tag has been found/added craft\web\twig\nodevisitors\BaseEventTagVisitor
$foundHead boolean Whether the head() tag has been found/added craft\web\twig\nodevisitors\BaseEventTagVisitor
Public Methods
Method Description Defined By
enterNode() Called before child nodes are visited. craft\web\twig\nodevisitors\EventTagAdder
getPriority() Returns the priority for this visitor. craft\web\twig\nodevisitors\EventTagAdder
leaveNode() Called after child nodes are visited. craft\web\twig\nodevisitors\EventTagAdder
Protected Methods
Method Description Defined By
foundAllEventTags() Returns whether all event tags have been found/added. craft\web\twig\nodevisitors\BaseEventTagVisitor

Method Details

enterNode() public method #

Called before child nodes are visited.

public Twig_Node enterNode ( Twig_Node $node, Twig_Environment $env )
$node
$env
return Twig_Node The modified node

getPriority() public method #

Returns the priority for this visitor.

Priority should be between -10 and 10 (0 is the default).

public integer getPriority ( )
return integer The priority level

leaveNode() public method #

Called after child nodes are visited.

public Twig_Node, false leaveNode ( Twig_Node $node, Twig_Environment $env )
$node
$env
return Twig_Node, false The modified node or false if the node must be removed