Skip to content

Kirby 6.0.1

$element->attr()

Returns the attribute value or the given fallback if the attribute does not exist

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

Parameters

Name Type Default
$attrrequired string no default value
$fallback stringornull null

Return types

stringornull

Parent class

Kirby\Parsley\Element