I have a form defined in the controller as shown below:
$addForm = $this->createFormBuilder() ->add('userIds', 'collection', array( 'type' => 'checkbox', 'allow_add' => true, 'options' => array( 'required' => false ) )) ->add('userId', 'hidden') ->getForm();
In the view, I show a datagrid with the option of volume removal. I use paginator for pagination. I manually show the fields in the view as shown below:
//Inside loop {%for items in pagination %} <input type="checkbox" name="form[userIds][]" class="ids" value="{{items.id}}"/> {%endfor%}
I get the data in the controller after the mail request, as shown below:
var_dump($data['userIds']);
When the user selects three checkboxes, I get the output as shown below:
array (size=4) 0 => boolean true 1 => boolean true 2 => boolean true 3 => boolean true
The values ββshould contain userIds, such as 1,5,6,7, but I only get boolean values. What I did wrong?
sonam source share