Skip to content

Kirby 4.5.0

$element->attr()

The returns the attribute value or the given fallback if the attribute does not exist

$element->attr(string $attr, ?string $fallback = null): string|null

Parameters

Name Type Default
$attr * string
$fallback string|null null

Return type

string|null

Parent class

Kirby\Parsley\Element