MetaTags
class MetaTags extends GroupedTagBuilder
Methods
Get the builder key.
Determine whether no meta tags are defined.
Get the dot-notated key this builder occupies in the Head::toArray() result.
Grouped tag builders are represented as an empty array when absent from the Head::toArray() result.
Get the supported route attribute names.
Build meta tags from a route attribute or alias.
Determine if the builder should render even when no data was set.
Resolve a string or string-backed enum value.
Normalize a route attribute value into a list of items.
Create the meta tag definitions.
Add or replace a meta tag for its attribute, key, and media.
Get the ordered meta tag definitions.
Determine whether the key belongs to an RDFa namespace.
Resolve the HTML attribute a meta tag is keyed under, honoring an explicit property flag and falling back to RDFa namespace detection.
Get the identity a meta tag is deduplicated by: attribute, key, and media query.
Get the stable Inertia ownership key for a meta tag.
Get the route attribute aliases for meta tag names.
Get the Inertia ownership aliases for meta tag names.
Details
at line 31
static string
key()
Get the builder key.
at line 103
TagBuilder
overlayOn(TagBuilder|null $base)
Overlay these meta tags onto the lower layer.
at line 115
bool
isEmpty()
Determine whether no meta tags are defined.
in
TagBuilder at line 32
static string
headArrayKey()
Get the dot-notated key this builder occupies in the Head::toArray() result.
in
GroupedTagBuilder at line 13
static mixed
headArrayDefault()
Grouped tag builders are represented as an empty array when absent from the Head::toArray() result.
at line 78
static array
routeAttributeKeys()
Get the supported route attribute names.
at line 39
static TagBuilder|null
fromRouteAttribute(string $key, mixed $value)
Build meta tags from a route attribute or alias.
in
TagBuilder at line 66
static bool
rendersWhenEmpty(ResolvedHead $head)
Determine if the builder should render even when no data was set.
in
TagBuilder at line 74
TagBuilder
asDefaults()
Mark the builder's data as belonging to the defaults layer.
at line 125
mixed
toHeadArray(ResolvedHead $head)
Get the meta tags for the head array.
at line 135
array
toTags(ResolvedHead $head, TagRenderer $tags)
Render the meta tags.
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 24
__construct(array $tags = [])
Create the meta tag definitions.
at line 86
MetaTags
tag(string $key, string $content, bool|null $property = null, Media|string|null $media = null)
Add or replace a meta tag for its attribute, key, and media.
at line 152
protected array
headArray()
Get the ordered meta tag definitions.
at line 160
protected bool
isRdfaProperty(string $key)
Determine whether the key belongs to an RDFa namespace.
at line 169
protected string
resolveAttribute(string $key, bool|null $property)
Resolve the HTML attribute a meta tag is keyed under, honoring an explicit property flag and falling back to RDFa namespace detection.
at line 177
protected string
tagKey(string $key, bool|null $property, string|null $media)
Get the identity a meta tag is deduplicated by: attribute, key, and media query.
at line 191
protected string
inertiaKey(array $meta)
Get the stable Inertia ownership key for a meta tag.
at line 206
static protected array
aliases()
Get the route attribute aliases for meta tag names.
at line 225
static protected array
inertiaAliases()
Get the Inertia ownership aliases for meta tag names.