/** * Constructor. * * Available options: * * * choices: An array of possible choices (required) * * label_separator: The separator to use between the input radio and the label * * separator: The separator to use between each input radio * * class: The class to use for the main <ul> tag * * formatter: A callable to call to format the radio 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('label_class', 'radio-inline'); $this->addOption('label_separator', ' '); $this->addOption('formatter', array($this, 'formatter')); $this->addOption('template', '%group% %options%'); }
/** * 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', ' '); $this->addOption('separator', "\n"); $this->addOption('formatter', array($this, 'formatter')); $this->addOption('template', '%group% %options%'); }
/** * Constructor. * * Available options: * * * choices: An array of possible choices (required) * * multiple: true if the select tag must allow multiple selections * * expanded: true to display an expanded widget * if expanded is false, then the widget will be a select * if expanded is true and multiple is false, then the widget will be a list of radio * if expanded is true and multiple is true, then the widget will be a list of checkbox * * renderer_class: The class to use instead of the default ones * * renderer_options: The options to pass to the renderer constructor * * renderer: A renderer widget (overrides the expanded and renderer_options options) * The choices option must be: new sfCallable($thisWidgetInstance, 'getChoices') * @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); $this->addOption('expanded', false); $this->addOption('renderer_class', false); $this->addOption('renderer_options', array()); $this->addOption('renderer', false); }
/** * Configure widget * * @param array $options Widget options [optional] * @param array $attributes Render attributes [optional] * @return void */ protected function configure($options = array(), $attributes = array()) { parent::configure($options, $attributes); $this->addOption('multiple', false); $this->addOption('expanded', false); $this->addOption('renderer_class', false); $this->addOption('renderer_options', array()); $this->addOption('renderer', false); $this->addOption('tabbed', false); $this->addOption('label_unassociated', 'choiceLabels.unassociated'); $this->addOption('label_associated', 'choiceLabels.associated'); $this->addOption('template_dl', '<div id="%id%" class="sf-dl-select-list %class%">%tabs%<div id="%id%-1">%associated%</div>' . '<div id="%id%-2">%unassociated%</div>%js%</div>'); }
/** * 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); }