Title
class Title extends TagBuilder
Methods
Get the builder key.
Determine whether no title value or options are defined.
Get the dot-notated key this builder occupies in the Head::toArray() result.
Get the value used in Head::toArray() when this builder has no data.
Get the route attribute keys this builder accepts values for.
Build a title from a route attribute.
Determine if the builder should render even when no data was set.
Default titles render exactly; the prefix and suffix only decorate page titles.
Resolve a string or string-backed enum value.
Normalize a route attribute value into a list of items.
Create a title definition with optional decoration.
Create a title with inherited decoration unless exact rendering is requested.
Render the title with its effective decoration.
Details
at line 29
static string
key()
Get the builder key.
at line 72
TagBuilder
overlayOn(TagBuilder|null $base)
Overlay this title while inheriting unspecified decoration.
at line 99
bool
isEmpty()
Determine whether no title value or options are defined.
in
TagBuilder at line 32
static string
headArrayKey()
Get the dot-notated key this builder occupies in the Head::toArray() result.
in
TagBuilder at line 40
static mixed
headArrayDefault()
Get the value used in Head::toArray() when this builder has no data.
in
TagBuilder at line 50
static array
routeAttributeKeys()
Get the route attribute keys this builder accepts values for.
at line 45
static TagBuilder|null
fromRouteAttribute(string $key, mixed $value)
Build a title from a route attribute.
in
TagBuilder at line 66
static bool
rendersWhenEmpty(ResolvedHead $head)
Determine if the builder should render even when no data was set.
at line 89
TagBuilder
asDefaults()
Default titles render exactly; the prefix and suffix only decorate page titles.
at line 126
mixed
toHeadArray(ResolvedHead $head)
Get the rendered title for the head array.
at line 136
array
toTags(ResolvedHead $head, TagRenderer $tags)
Render the title tag.
in
TagBuilder at line 100
static protected string|null
string(mixed $value)
Return the value when it is a string.
in
TagBuilder at line 108
static protected string|null
stringOrBackedEnum(mixed $value)
Resolve a string or string-backed enum value.
in
TagBuilder at line 124
static protected bool|null
bool(mixed $value)
Return the value when it is a boolean.
in
TagBuilder at line 132
static protected int|null
int(mixed $value)
Return the value when it is an integer.
in
TagBuilder at line 142
static protected array
items(mixed $value)
Normalize a route attribute value into a list of items.
in
TagBuilder at line 153
static protected array
named(array $values)
Filter an array down to its string-keyed values.
at line 18
__construct(string|null $value = null, bool|null $exact = null, string|null $prefix = null, string|null $suffix = null)
Create a title definition with optional decoration.
at line 37
static Title
make(string $value, string|null $prefix = null, string|null $suffix = null, bool|null $exact = null)
Create a title with inherited decoration unless exact rendering is requested.
at line 110
string|null
render()
Render the title with its effective decoration.