vendredi 4 septembre 2015

How to create multiple checkboxes grouped by fieldsets in Cakephp 3

I'm having a problem following this documentation :

Cakephp3 Cookbook - Form - Creating Select Pickers I tried the 'multiple checkboxes' part :

$options = [
   'Group 1' => [
      'Value 1' => 'Label 1',
      'Value 2' => 'Label 2'
   ],
   'Group 2' => [
      'Value 3' => 'Label 3'
   ]
];
echo $this->Form->select('field', $options, ['multiple' => 'checkbox']);

but the output was an error like this :

Notice (8): Array to string conversion [CORE/src/View/StringTemplate.php, line 238]

it's like telling me that the value of the array should be a string instead of an Array, but is there anyway to make this work ? Please can anyone help me solve this problem ?




Aucun commentaire:

Enregistrer un commentaire