Skip to content

Kirby 6.0.0

Html::a()

Generates an <a> tag; automatically supports mailto: and tel: links

Html::a(string $href, string|array|null $text = null, array $attr = []): string

Parameters

Name Type Default Description
$hrefrequired string no default value The URL for the <a> tag
$text stringorarrayornull null The optional text; if null, the URL will be used as text
$attr array [] Additional attributes for the tag

Return type

string

Parent class

Kirby\Cms\Html inherited from Kirby\Toolkit\Html