Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/cocoa/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Zend framework2 ZF2表单元素数据属性_Zend Framework2_Zend Form - Fatal编程技术网

Zend framework2 ZF2表单元素数据属性

Zend framework2 ZF2表单元素数据属性,zend-framework2,zend-form,Zend Framework2,Zend Form,这很可能是直截了当的,或者是复杂的,但接下来 如何将数据属性添加到表单元素?简单地说: $element->setAttribute('data', 'somedata'); 简单地说: $element->setAttribute('data', 'somedata'); 简单地说: $element->setAttribute('data', 'somedata'); 简单地说: $element->setAttribute('data', 'somedata'

这很可能是直截了当的,或者是复杂的,但接下来

如何将数据属性添加到表单元素?

简单地说:

$element->setAttribute('data', 'somedata');
简单地说:

$element->setAttribute('data', 'somedata');
简单地说:

$element->setAttribute('data', 'somedata');
简单地说:

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

现在踢我自己

只记得我以前已经做过了

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

.马上踢我自己

只记得我以前已经做过了

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

.马上踢我自己

只记得我以前已经做过了

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

.马上踢我自己

只记得我以前已经做过了

...
'attributes' => array(
    ...
    'data-xxx' => '',
    ...
),
>。你说得不太对;这不是
$element->setAttrib()
(那是ZF1)你说得不对;这不是
$element->setAttrib()
(那是ZF1)你说得不对;这不是
$element->setAttrib()
(那是ZF1)你说得不对;它不是
$element->setAttrib()
(那是ZF1)