The Dom\TokenList class
(PHP 8 >= 8.4.0)
Introduction
Represents a set of tokens in an attribute (e.g. class names).
Class synopsis
/* Properties */
/* Methods */
}Properties
- length
- The number of tokens.
- value
- The value of the attribute linked to this object.
Notes
Note: The DOM extension uses UTF-8 encoding when working with methods or properties. The parser methods auto-detect the encoding or allow the caller to specify an encoding.
Note: Tokens in the list can be accessed by array syntax.
Table of Contents
- Dom\TokenList::add — Adds the given tokens to the list
- Dom\TokenList::contains — Returns whether the list contains a given token
- Dom\TokenList::count — Returns the number of tokens in the list
- Dom\TokenList::getIterator — Returns an iterator over the token list
- Dom\TokenList::item — Returns a token from the list
- Dom\TokenList::remove — Removes the given tokens from the list
- Dom\TokenList::replace — Replaces a token in the list with another one
- Dom\TokenList::supports — Returns whether the given token is supported
- Dom\TokenList::toggle — Toggles the presence of a token in the list
↑ and ↓ to navigate • Enter to select • Esc to close • / to open