i have a problem with my Form in symfony.
first the code:
$test = array();
foreach($docGrp as $dc){
$test[] = $dc->getGruppenName();
}
$form = $this->createFormbuilder($document)
->add('gruppe', 'choice', array(
'choices' =>array(
'Gruppen' => $test,
),
'multiple' => true,
'expanded' => true,
))
->getForm();
I want that the array is displayed as checkboxes and the values of it should be the values in the array. However, i get an Exception which says
"An exception has been thrown during the rendering of a template ("Warning: strtr() expects parameter 1 to be string, array given"
So if i change the choices to "Gruppen => "test" it works. But it defeats the purpose, i need to get those values out of the array.
If someone knows what i mean, help would be cool :)
so far Adi