views:

469

answers:

1

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 !

A: 

Solution was to use a personalised view helper to render the right HTML markup.

This article, about Zend_Form and helpers has really helped. A must-read !

Alexis Métaireau