The Dom\TokenList class

(PHP 8 >= 8.4.0)

简介

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

类摘要

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

属性

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

注释

注意: 此 DOM 扩展在处理方法或属性时使用 UTF-8 编码。 解析器方法会自动检测编码,或允许调用者指定编码。

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

目录

添加备注

用户贡献的备注

此页面尚无用户贡献的备注。
To Top