You are here

public function EventHandler::startTag in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/masterminds/html5/src/HTML5/Parser/EventHandler.php \Masterminds\HTML5\Parser\EventHandler::startTag()

A start tag.

IMPORTANT: The parser watches the return value of this event. If this returns an integer, the parser will switch TEXTMODE patters according to the int.

This is how the Tree Builder can tell the Tokenizer when a certain tag should cause the parser to go into RAW text mode.

The HTML5 standard requires that the builder is the one that initiates this step, and this is the only way short of a circular reference that we can do that.

Example: if a startTag even for a `script` name is fired, and the startTag() implementation returns Tokenizer::TEXTMODE_RAW, then the tokenizer will switch into RAW text mode and consume data until it reaches a closing `script` tag.

The textmode is automatically reset to Tokenizer::TEXTMODE_NORMAL when the closing tag is encounter. **This behavior may change.**

Parameters

string $name: The tag name.

array $attributes: An array with all of the tag's attributes.

boolean $selfClosing: An indicator of whether or not this tag is self-closing (<foo/>)

Return value

numeric One of the Tokenizer::TEXTMODE_* constants.

2 methods override EventHandler::startTag()
DOMTreeBuilder::startTag in vendor/masterminds/html5/src/HTML5/Parser/DOMTreeBuilder.php
Process the start tag.
EventStack::startTag in vendor/masterminds/html5/test/HTML5/Parser/EventStack.php
A start tag.

File

vendor/masterminds/html5/src/HTML5/Parser/EventHandler.php, line 74

Class

EventHandler
Standard events for HTML5.

Namespace

Masterminds\HTML5\Parser

Code

public function startTag($name, $attributes = array(), $selfClosing = false);