phpday 2027 - Call for Papers

The Dom\TokenList class

(PHP 8 >= 8.4.0)

Introduzione

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

Sommario della classe

final class Dom\TokenList implements IteratorAggregate, Countable {
/* Proprietà */
public readonly int $length;
public string $value;
/* Metodi */
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
}

Proprietà

length

The number of tokens.

value

The value of the attribute linked to this object.

Note

Nota:

L'estensione DOM usa la codifica UTF-8 quando si lavora con metodi o proprietà. I metodi del parser rilevano automaticamente la codifica o consentono al chiamante di specificarne una.

Nota:

Tokens in the list can be accessed by array syntax.

Indice dei contenuti

User Contributed Notes

There are no user contributed notes for this page.
Adding new notes is disabled. Please see the links in the Found A Problem? section.
To Top