Tag
final class Tag
Represents a Latte tag or n:attribute during parsing.
Constants
| PrefixInner |
|
| PrefixTag |
|
| PrefixNone |
|
| OutputNone |
|
| OutputKeepIndentation |
|
| OutputRemoveIndentation |
|
Properties
| $parser | |||
| $outputMode |
Methods
No description
No description
No description
No description
Returns the tag notation, e.g. {tagName} or n:tagName="...".
Finds the nearest ancestor tag whose node is an instance of one of the given classes, optionally filtered by a condition. Returns null if none is found.
Throws a CompileException if the tag has no arguments.
Replaces the current n:attribute node in the parent HTML element with the given node.
Details
at line 36
__construct(string $name, array $tokens, Range $position, bool $void = false, bool $closing = false, bool $inHead = false, bool $inTag = false, ElementNode|null $htmlElement = null, Tag|null $parent = null, string|null $prefix = null, AreaNode|null $node = null, AreaNode|null $nAttribute = null)
No description
at line 54
bool
isInHead()
No description
at line 60
bool
isInText()
No description
at line 66
bool
isNAttribute()
No description
at line 75
string
getNotation(bool $withArgs = false)
Returns the tag notation, e.g. {tagName} or n:tagName="...".
at line 94
Tag|null
closestTag(array $classes, callable|null $condition = null)
Finds the nearest ancestor tag whose node is an instance of one of the given classes, optionally filtered by a condition. Returns null if none is found.
at line 111
void
expectArguments(string $what = 'arguments')
Throws a CompileException if the tag has no arguments.
at line 122
void
replaceNAttribute(AreaNode $node)
Replaces the current n:attribute node in the parent HTML element with the given node.