Skip to content

HTMLPurifier_Token_Tag

Abstract class of a tag token (start, end or empty), and its behavior.

  • Full name: \HTMLPurifier_Token_Tag
  • Parent class: \HTMLPurifier_Token
  • This class is an Abstract class

Properties

is_tag

Static bool marker that indicates the class is a tag.

public $is_tag

This allows us to check objects with !empty($obj->is_tag) without having to use a function call is_a().


name

The lower-case name of the tag, like 'a', 'b' or 'blockquote'.

public $name

attr

Associative array of the tag's attributes.

public $attr

Methods

__construct

Non-overloaded constructor, which lower-cases passed tag name.

public __construct(string $name, array $attr = array(), int $line = null, int $col = null, array $armor = array()): mixed

Parameters:

Parameter Type Description
$name string String name.
$attr array Associative array of attributes.
$line int
$col int
$armor array

toNode

Converts a token into its corresponding node.

public toNode(): mixed

Inherited methods

__get

public __get(string $n): null|string

Parameters:

Parameter Type Description
$n string

position

Sets the position of the token in the source document.

public position(int $l = null, int $c = null): mixed

Parameters:

Parameter Type Description
$l int
$c int

rawPosition

Convenience function for DirectLex settings line/col position.

public rawPosition(int $l, int $c): mixed

Parameters:

Parameter Type Description
$l int
$c int

toNode

Converts a token into its corresponding node.

public toNode(): mixed
  • This method is abstract.


Automatically generated on 2025-03-18