Вопрос

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?

Это было полезно?

Решение

Simply:

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

Другие советы

Kicking myself right now!

Just remembered I'd already done it previously.

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

>.<

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top