Xml::attr()
Generates a single attribute or a list of attributes
Parameters
Name | Type | Default | Description |
---|---|---|---|
$name * | array |string |
– | String: A single attribute with that name will be generated. Key-value array: A list of attributes will be generated. Don't pass a second argument in that case. |
$value | mixed |
null |
If used with a $name string, pass the value of the attribute here.If used with a $name array, this can be set to false to disable attribute sorting. |
Return type
string
|null
Parent class
Examples
Since 3.9.0
Support for the Xml::attr(['selected'])
syntax without value was added in Kirby 3.9.0.