0

I want understand what the widget can I use to generate such html:

<input name="users[]" value="Robert" type="checkbox"> Robert
<input name="users[]" value="Bob" type="checkbox"> Bob

Or perhaps symfony doesn't have that widget and I have to write it myself? Thanks

2 Answers 2

3

Check this: http://www.symfony-project.org/forms/1_2/en/A-Widgets#chapter_a_sub_choice_representations

As they explain, you may try this code:

$w = new sfWidgetFormChoice(array(
  'expanded' => true,
  'multiple' => true,
  'choices'  => array('A week of symfony', 'Call the expert', 'Community'),
));

It will produce this: multiple select with checkboxes
(source: symfony-project.org)

Sign up to request clarification or add additional context in comments.

1 Comment

Not with these parameters. With these parameters it is equivalent to sfWidgetFormSelectCheckbox . Check the link.
0

Yeah! I found it! It is sfWidgetFormSelectCheckbox that widget I find

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.