Constructor – creates a reference to a token in some external HTML string.
Parameters
$bookmark_namestring|nullrequired- Name of bookmark corresponding to location in HTML where token is found, or
nullfor markers and nodes without a bookmark. $node_namestringrequired- Name of node token represents; if uppercase, an HTML element; if lowercase, a special value like "marker".
$has_self_closing_flagboolrequired- Whether the source token contains the self-closing flag, regardless of whether it’s valid.
$on_destroycallable|nulloptional- Function to call when destroying token, useful for releasing the bookmark.
Default:
null
Source
public function __construct( ?string $bookmark_name, string $node_name, bool $has_self_closing_flag, ?callable $on_destroy = null ) {
$this->bookmark_name = $bookmark_name;
$this->namespace = 'html';
$this->node_name = $node_name;
$this->has_self_closing_flag = $has_self_closing_flag;
$this->on_destroy = $on_destroy;
}
Changelog
| Version | Description |
|---|---|
| 6.4.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.