| Methods |
public
|
__construct(string $template = '')
|
#
|
public
|
_hasTag(string $tag): bool
|
#
|
public
|
hasTag(string|list<string> $tag): bool
|
#
|
public
|
getTagTree(string $tag): TagTree
|
#
|
private
|
cloneTagTrees(array $tagTrees): array
|
#
|
public
|
__clone()
|
#
|
public
|
cloneRegion(string $tag): static
|
#
|
protected
|
_unsetFromTagTree(TagTree $tagTree, int $k): void
|
#
|
protected
|
emptyTagTree(TagTree $tagTree): void
|
#
|
protected
|
_setOrAppend(
string|array<string, string>|Model $tag,
($tag is array|Model ? never : string|null) $value = null,
bool $encodeHtml = true,
bool $append = false,
bool $throwIfNotFound = true,
): void
Internal method for setting or appending content in $tag.
Internal method for setting or appending content in $tag.
If tag contains another tag trees, these tag trees are emptied.
|
#
|
public
|
set(string|array<string, string>|Model $tag, ($tag is array|Model ? never : string|null) $value = null): $this
This function will replace region referred by $tag to a new content.
This function will replace region referred by $tag to a new content.
If tag is found inside template several times, all occurrences are
replaced.
|
#
|
public
|
trySet(string|array<string, string>|Model $tag, ($tag is array|Model ? never : string|null) $value = null): $this
Same as set(), but won't generate exception for non-existing
$tag.
Same as set(), but won't generate exception for non-existing
$tag.
|
#
|
public
|
dangerouslySetHtml(
string|array<string, string>|Model $tag,
($tag is array|Model ? never : string|null) $value = null,
): $this
Set value of a tag to a HTML content. The value is set without
encoding, so you must be sure to sanitize.
Set value of a tag to a HTML content. The value is set without
encoding, so you must be sure to sanitize.
|
#
|
public
|
tryDangerouslySetHtml(
string|array<string, string>|Model $tag,
($tag is array|Model ? never : string|null) $value = null,
): $this
See dangerouslySetHtml() but won't generate exception for non-existing
$tag.
See dangerouslySetHtml() but won't generate exception for non-existing
$tag.
|
#
|
public
|
append(string|array<string, string>|Model $tag, ($tag is array|Model ? never : string|null) $value): $this
Add more content inside a tag.
Add more content inside a tag.
|
#
|
public
|
tryAppend(string|array<string, string>|Model $tag, ($tag is array|Model ? never : string|null) $value): $this
Same as append(), but won't generate exception for non-existing
$tag.
Same as append(), but won't generate exception for non-existing
$tag.
|
#
|
public
|
dangerouslyAppendHtml(
string|array<string, string>|Model $tag,
($tag is array|Model ? never : string|null) $value,
): $this
Add more content inside a tag. The content is appended without
encoding, so you must be sure to sanitize.
Add more content inside a tag. The content is appended without
encoding, so you must be sure to sanitize.
|
#
|
public
|
tryDangerouslyAppendHtml(
string|array<string, string>|Model $tag,
($tag is array|Model ? never : string|null) $value,
): $this
Same as dangerouslyAppendHtml(), but won't generate exception for non-existing
$tag.
Same as dangerouslyAppendHtml(), but won't generate exception for non-existing
$tag.
|
#
|
public
|
del(string|list<string> $tag): $this
Empty contents of specified region. If region contains sub-hierarchy,
it will be also removed.
Empty contents of specified region. If region contains sub-hierarchy,
it will be also removed.
|
#
|
public
|
tryDel(string|list<string> $tag): $this
Similar to del() but won't throw exception if tag is not present.
Similar to del() but won't throw exception if tag is not present.
|
#
|
public
|
loadFromFile(string $filename): $this
|
#
|
public
|
tryLoadFromFile(string $filename): $this|false
Same as load(), but will not throw an exception.
Same as load(), but will not throw an exception.
|
#
|
public
|
loadFromString(string $str): $this
|
#
|
protected
|
parseTemplateTree(array &$inputReversed, string $openedTag = null): TagTree
|
#
|
protected
|
parseTemplate(string $str): void
|
#
|
public
|
toLoadableString(string $region = self::TOP_TAG): string
|
#
|
public
|
renderToHtml(string $region = null): string
|
#
|
protected
|
renderTagTreeToHtml(TagTree $tagTree): string
|
#
|