Frage

This is more than likely going to be straight forward, or convoluted, but here goes...

How do you add a data attribute to a form element?

War es hilfreich?

Lösung

Simply:

$element->setAttribute('data', 'somedata');

Andere Tipps

Kicking myself right now!

Just remembered I'd already done it previously.

...
'attributes' => array(
    ...
    'data-xxx' => '',
    ...
),

>.<

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top