Example #1
0
 /**
  * Constructor.
  *
  * Available options:
  *
  *  * choices:         An array of possible choices (required)
  *  * label_separator: The separator to use between the input checkbox and the label
  *  * class:           The class to use for the main <ul> tag
  *  * separator:       The separator to use between each input checkbox
  *  * formatter:       A callable to call to format the checkbox choices
  *                     The formatter callable receives the widget and the array of inputs as arguments
  *  * template:        The template to use when grouping option in groups (%group% %options%)
  *
  * @param array $options     An array of options
  * @param array $attributes  An array of default HTML attributes
  *
  * @see sfWidgetFormChoiceBase
  */
 protected function configure($options = array(), $attributes = array())
 {
     parent::configure($options, $attributes);
     $this->addOption('class', 'checkbox_list');
     $this->addOption('label_separator', '&nbsp;');
     $this->addOption('separator', "\n");
     $this->addOption('formatter', array($this, 'formatter'));
     $this->addOption('template', '%group% %options%');
 }
Example #2
0
 /**
  * Constructor.
  *
  * Available options:
  *
  *  * choices:  An array of possible choices (required)
  *  * multiple: true if the select tag must allow multiple selections
  *
  * @param array $options     An array of options
  * @param array $attributes  An array of default HTML attributes
  *
  * @see sfWidgetFormChoiceBase
  */
 protected function configure($options = array(), $attributes = array())
 {
     parent::configure($options, $attributes);
     $this->addOption('multiple', false);
 }