I've a form in Zend that I use to manage the privileges of a series of resources (we're talking about dynamic ACLs stored in a db). So, for each of them I want to decide, through a select element (dropdown) who has the access. The controller will receive the request and handle it. My question is: how can I do to add elements to the form for having the possibility to store all the choices in one single array composed by many elements as the number of select element of form? Can I ask you a short real example? Thank you!
1 Answer
$myArray = array( ''=>'Select',
'Father'=>'Father',
'Mother'=>'Mother',
'Brother'=>'Brother',
'Sister'=>'Sister',
'Daughter'=>'Daughter',
'Son'=>'Son',
'Other'=>'Other',
);
'relationship' => array(
'type'=>'select',
'options'=>
array(
'label'=>'Relation',
'multiOptions' => $myArray,
)
),
OR