The Dom\TokenList class

(PHP 8 >= 8.4.0)

Einführung

Represents a set of tokens in an attribute (e.g. class names).

Klassenbeschreibung

final class Dom\TokenList implements IteratorAggregate, Countable {
/* Eigenschaften */
public readonly int $length;
public string $value;
/* Methoden */
public function add(string ...$tokens): void
public function contains(string $token): bool
public function count(): int
public function getIterator(): Iterator
public function item(int $index): ?string
public function remove(string ...$tokens): void
public function replace(string $token, string $newToken): bool
public function supports(string $token): bool
public function toggle(string $token, ?bool $force = null): bool
}

Eigenschaften

length
The number of tokens.
value
The value of the attribute linked to this object.

Anmerkungen

Hinweis: Die Erweiterung DOM verwendet die UTF-8-Kodierung, wenn sie mit Methoden oder Eigenschaften arbeitet. Die Parser-Methoden erkennen die Kodierung automatisch oder erlauben es dem Aufrufer, eine Kodierung anzugeben.

Hinweis: Tokens in the list can be accessed by array syntax.

Inhaltsverzeichnis