Bonjour;

J'utilise le framework Silex. Et j'ai un input Text je voudrais le changer par une CheckBox a multiple choix.
Mon code est:

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
$app->get('/Chart/{A}/{B}/{C}/{D}', function(Request $request, $A, $B, $C, $D) use ($app) {
 
if ($app['security']->isGranted('ROLE_USER')) {
        ///start form 
        $user = $app['security']->getToken()->getUser();
        $form = $app['form.factory']->createBuilder('form')->setMethod('GET')
 
         ->add('Article', 'text', array(
                    'data' => '',
                    'required' => FALSE))
Je l'ai changé pour avoir une checkBox mais il m'a affiché une liste a un seul choix:

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
->add('Article', 'choice', array(
 
'choices' => array('A' => 'B',
                        'B' => 'B',
                        'C' => 'C',
                        'D' => 'D',
                        'OTHERS' => 'OTHERS'),
                    'required' => FALSE,
                    'empty_value' => 'ALL',
                    'empty_data' => NULL
                ))
Comment je peux le changer s'il vous plait ?
Merci.