0

I'm currently trying to use Zend_Form, and it's decorators mechanism, in order to output some well formated HTML, but I don't manage to have the wanted output.

Concretely, I have a radio button form element (Zend_Form_Element_Radio), with a multiple option registred in it, like this:

$codeHolder = new Zend_Form_Element_Radio('radiobuttons');
$codeHolder->setLabel('Title');
$codeHolder->addMultiOptions(array( 1       =>  'Label1',
                                    2       =>  'Label2',
                                    3       =>  'Label3'));
$codeHolder->setValue('depart');

Here is the wanted HTML output:

`<tr>
<td><input type="radio" name="label1[radiobuttons]" id="id1" value="1" /></td>
<td><input type="radio" name="label1[radiobuttons]" id="id2" value="2" /></td>
<td><input type="radio" name="label1[radiobuttons]" id="id3" value="3" /><</td>
</tr>`

I have turned in many ways the problem, but I don't see any solution. Any help will be appreciated !

4

1 回答 1

0

解决方案是使用个性化的视图助手来呈现正确的 HTML 标记。

这篇关于 Zend_Form 和助手的文章确实很有帮助。必读!

于 2009-09-01T16:57:14.450 回答