we have a php project using zend framework and in a page we have multicheck box
for this i use this code to create multiCheckBox:
$mozoo = new Zend_Form_Element_MultiCheckbox('mozoo');
then i add the elements to it using this code
$mozoo->addMultiOption ($tagRecord['name'],$tagRecord['name'])
$tagRecord is a record i read from database.
some of options are the parents of each other and i want to make beautiful my multiCheckBox using Jquery with showing and hiding these elements i have to store chekboxes parents some where so i thought it would be nice to set it in id and class (class = the id of the parent, id = the checkbox itself).
how can i set options fot multi option box?
ZF will automatically create multi options with each own id, but it is not possible to pass in class value on each multi option, well, unless you go into ZF core and fix it yourself, which I dont recommend to do.
The far better solution would be to implement your own decorator that will render the multi checkbox element in different way than viewRenderer decorator would (by calling View/Helper/FormMultiCheckbox), but this approach would require lots of coding and deeper understanding of how form decorators work.
To help you understand form decorators see here