我有带有字段的表格:
$this -> add(
array(
'name' => 'firstfield',
'attributes' => array(
'type' => 'text',
'id' => 'id_firstfield'
),
'options' => array(
'label' => 'firstfield'
),
)
);
$this -> add(
array(
'name' => 'secondfield',
'attributes' => array(
'type' => 'text',
'id' => 'id_secondfield'
),
'options' => array(
'label' => 'secondfield'
),
)
);
当我使用:
echo $this->formCollection($form);
在我看来,我得到:
[...]
<label for="id_firstfield">first field</label>
<input name="firstfield" type="text" id="id_firstfield" value="">
<label for="id_secondfield">second field</label>
<input name="secondfield" type="text" id="id_secondfield" value="">
[...]
但我想得到:
[...]
<div id="divforfirstfield">
<label for="id_firstfield">first field</label>
<input name="firstfield" type="text" id="id_firstfield" value="">
</div>
<div id="divforsecondfield">
<label for="id_secondfield">second field</label>
<input name="secondfield" type="text" id="id_secondfield" value="">
</div>
[...]
这个怎么做?