Reference

Guide

Html::attr()

Generates a single attribute or a list of attributes

Html::attr(string $name, string $value = null): string

Parameters

Name Type Default Description
$name string

mixed string: a single attribute with that name will be generated. array: a list of attributes will be generated. Don't pass a second argument in that case.

$value string null

if used for a single attribute, pass the content for the attribute here

Return type

string

Inherited from

Kirby\Toolkit\Html

Source code

kirby/src/Toolkit/Html.php#L82