Welcome to the Cookbook

loading...

7.3.3.5 $options[‘multiple’]

If ‘multiple’ has been set to true for an input that outputs a select, the select will allow multiple selections. Alternatively set ‘multiple’ to ‘checkbox’ to output a list of related check boxes.

$form->input('Model.field', array( 'type' => 'select', 'multiple' => true ));
$form->input('Model.field', array( 'type' => 'select', 'multiple' => 'checkbox' ));
  1. $form->input('Model.field', array( 'type' => 'select', 'multiple' => true ));
  2. $form->input('Model.field', array( 'type' => 'select', 'multiple' => 'checkbox' ));