Zend_Form and decorators

4 views
Skip to first unread message

Zormoni

unread,
Sep 10, 2009, 2:43:57 AM9/10/09
to Zend Framework Developers
I have a problem relating the Zend_Form.

I´m adding a bunch of checkboxes onto my form, using the following
code:

[code]
$roleElement = new Zend_Form_Element_MultiCheckbox( 'roleid' );
$roleElement->setLabel('Part/Instrument');
$roleDAO = new Role();
$counter = 0;
foreach( $roleDAO->fetchAllRoles() as $role )
{
if ( $counter == 3 )
{
$roleElement->addMultiOption( $role->id, $role->rolegroup . " - " .
$role->role );
//@TODO
//Insert class last here onto tag - <input type="checkbox"
class="last" name="roleid[]" />
$counter = 0;
}
else
{
$roleElement->addMultiOption( $role->id, $role->rolegroup . " - " .
$role->role );
$counter ++;
}

}
[/code]

What I want to do is to access the input tag in the function
addMultiOption, so I can add the class "last" in every fourth pass.
But I have a trouble finding a way to access it. Any ideas?
Reply all
Reply to author
Forward
0 new messages