EventTagFinder

Type
Class
Namespace
craft\web\twig\nodevisitors
Inherits
craft\web\twig\nodevisitors\EventTagFinder » craft\web\twig\nodevisitors\BaseEventTagVisitor
Implements
Twig_NodeVisitorInterface
Since
3.0

EventTagFinder looks for head(), beginBody(), and endBody() event tags in templates as they’re being compiled.

View source

Protected Properties

PropertyDescription
$foundBeginBodyboolean – Whether the beginBody() tag has been found/added
$foundEndBodyboolean – Whether the endBody() tag has been found/added
$foundHeadboolean – Whether the head() tag has been found/added

Public Methods

MethodDescription
enterNode()Called before child nodes are visited.
getPriority()Returns the priority for this visitor.
leaveNode()Called after child nodes are visited.

enterNode()

Called before child nodes are visited.

View source

Arguments

  • $node
  • $env

Returns

Twig_Node – The modified node

Signature

public Twig_Node enterNode ( Twig_Node $node, Twig_Environment $env )

getPriority()

Returns the priority for this visitor.

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

View source

Returns

integer – The priority level

Signature

public integer getPriority ( )

leaveNode()

Called after child nodes are visited.

View source

Arguments

  • $node
  • $env

Returns

Twig_Node, false – The modified node or false if the node must be removed

Signature

public Twig_Node, false leaveNode ( Twig_Node $node, Twig_Environment $env )

Protected Methods

MethodDescription
foundAllEventTags()Returns whether all event tags have been found/added.