public function configure($options = array(), $attributes = array()) { parent::configure($options, $attributes); $this->addRequiredOption('page_id'); $this->addRequiredOption('page_culture'); $this->setOption('choices', array()); }
/** * Configures the current widget. * * Available options: * * * url: The URL to call to get the choices to use (required) * * config: A JavaScript array that configures the JQuery autocompleter widget * * value_callback: A callback that converts the value before it is displayed * * @param array $options An array of options * @param array $attributes An array of default HTML attributes * * @see sfWidgetForm */ protected function configure($options = array(), $attributes = array()) { $this->addOption('culture', sfContext::getInstance()->getUser()->getCulture()); $this->addOption('width', 'resolve'); parent::configure($options, $attributes); }
public function configure($options = array(), $attributes = array()) { parent::configure($options, $attributes); $this->addRequiredOption('property'); $this->addOption('add_empty', true); $this->setOption('choices', array()); }
protected function configure($options = array(), $attributes = array()) { parent::configure($options, $attributes); if (!isset($options['renderer_class'])) { $this->setOption('renderer_class', 'WidgetFormSelectBootstrapRadio'); } }
public function configure($options = array(), $attributes = array()) { $this->addOption('add_empty', false); $this->addOption('order', null); parent::configure($options, $attributes); $this->setOption('choices', array()); }
public function configure($options = array(), $attributes = array()) { parent::configure($options, $attributes); $this->addOption('multiple', true); $this->addOption('extended', true); $this->addOption('is_choose', false); }
/** * Options: * * * model: the model (required) * * add_empty: if add an empty option (false by default) * * method: the method to show the document (__toString by default) * * find_options: the options for the find (empty array by default) * * @see sfWidgetFormSelect */ protected function configure($options = array(), $attributes = array()) { $this->addRequiredOption('model'); $this->addOption('add_empty', false); $this->addOption('method', '__toString'); $this->addOption('find_options', array()); parent::configure($options, $attributes); }
public function configure($options = array(), $attributes = array()) { parent::configure($options, $attributes); $this->addOption('multiple', true); $this->addOption('extended', true); $this->addRequiredOption('user_ref'); $this->addRequiredOption('collection_ref'); }
protected function configure($options = array(), $attributes = array()) { parent::configure($options, $attributes); $this->addRequiredOption('petition_id'); $this->addRequiredOption('petition_text_id'); $this->addOption('choices'); $this->addOption('renderer_class', 'sfWidgetFormSelectPetitionTextHash'); }
/** * Constructor. * * Available options: * * * culture: The culture to use for internationalized strings * * languages: An array of language codes to use * * add_empty: Whether to add a first empty value or not (false by default) * If the option is not a Boolean, the value will be used as the text value * * @param array $options An array of options * @param array $attributes An array of default HTML attributes * * @see sfWidgetFormChoice */ public function configure($options = array(), $attributes = array()) { $this->addOption('culture'); $this->addOption('languages'); $this->addOption('add_empty', false); parent::configure($options, $attributes); $this->setOption('choices', array()); }
protected function configure($options = array(), $attributes = array()) { $this->addRequiredOption('model_id'); $this->addOption('parent_id', null); $this->addOption('name', null); $this->addOption('module', 'politico'); parent::configure($options, $attributes); }
/** * Constructor. * * Available options: * * * model: The model class (required) * * table_method: A method to return a formatted array of key => value (required) * * table_method_params: An array of parameters to pass to the table_method * * add_empty: Whether to add a first empty value or not (false by default) * If the option is not a Boolean, the value will be used as the text value * * multiple: true if the select tag must allow multiple selections (false by default) * * @see sfWidgetFormChoice */ protected function configure($options = array(), $attributes = array()) { $this->addRequiredOption('model'); $this->addRequiredOption('table_method'); $this->addOption('table_method_params', null); $this->addOption('add_empty', false); $this->addOption('multiple', false); parent::configure($options, $attributes); }
/** * * 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); }
/** * Constructor. * * Available options: * * * root_id: The root_id (required) * * add_empty: Whether to add a first empty value or not (false by default) * If the option is not a Boolean, the value will be used as the text value * * method: The method to use to display object values (__toString by default) * * key_method: The method to use to display the object keys (getPrimaryKey by default) * * * * query: Custom query * * @see sfWidgetFormSelect */ protected function configure($options = array(), $attributes = array()) { $this->addRequiredOption('root_id'); $this->addOption('add_empty', false); $this->addOption('method', '__toString'); $this->addOption('key_method', 'getPrimaryKey'); $this->addOption('multiple', false); $this->addOption('query', false); parent::configure($options, $attributes); }
/** * Constructor. * * Available options: * * * model: The model class (required) * * add_empty: Whether to add a first empty value or not (false by default) * If the option is not a Boolean, the value will be used as the text value * * method: The method to use to display object values (__toString by default) * * key_method: The method to use to display the object keys (getPrimaryKey by default) * * base_query: The base_query for nested set * * multiple: true if the select tag must allow multiple selections * * level_character: The character used to represent a level (- by default) * * @see sfWidgetFormSelect */ protected function configure($options = array(), $attributes = array()) { $this->addRequiredOption('model'); $this->addOption('add_empty', false); $this->addOption('method', '__toString'); $this->addOption('key_method', 'getPrimaryKey'); $this->addOption('base_query', null); $this->addOption('multiple', false); $this->addOption('level_character', ' '); parent::configure($options, $attributes); }
/** * Constructor. * * Available options: * * * model: The model class (required) * * add_empty: Whether to add a first empty value or not (false by default) * If the option is not a Boolean, the value will be used as the text value * * method: The method to use to display object values (__toString by default) * * order_by: An array composed of two fields: * * The column to order by the results (must be in the PhpName format) * * asc or desc * * query: A query to use when retrieving objects * * connection: The Doctrine connection to use (null by default) * * multiple: true if the select tag must allow multiple selections * * @see sfWidgetFormSelect */ protected function configure($options = array(), $attributes = array()) { $this->addRequiredOption('model'); $this->addOption('add_empty', false); $this->addOption('method', '__toString'); $this->addOption('order_by', null); $this->addOption('query', null); $this->addOption('connection', null); $this->addOption('multiple', false); parent::configure($options, $attributes); }
/** * Constructor. * * Available options: * * * model: The model class (required) * * add_empty: Whether to add a first empty value or not (false by default) * If the option is not a Boolean, the value will be used as the text value * * method: The method to use to display object values (__toString by default) * * key_method: The method to use to display the object keys (getPrimaryKey by default) * * order_by: An array composed of two fields: * * The column to order by the results (must be in the PhpName format) * * asc or desc * * criteria: A criteria to use when retrieving objects * * connection: The Propel connection to use (null by default) * * multiple: true if the select tag must allow multiple selections * * peer_method: The peer method to use to fetch objects * * @see sfWidgetFormSelect */ protected function configure($options = array(), $attributes = array()) { $this->addRequiredOption('model'); $this->addOption('add_empty', false); $this->addOption('method', '__toString'); $this->addOption('key_method', 'getPrimaryKey'); $this->addOption('order_by', null); $this->addOption('criteria', null); $this->addOption('connection', null); $this->addOption('multiple', false); $this->addOption('peer_method', 'doSelect'); parent::configure($options, $attributes); }
/** * Constructor. * * Available options: * * * culture: The culture to use for internationalized strings * * add_empty: Whether to add a first empty value or not (false by default) * If the option is not a Boolean, the value will be used as the text value * * @param array $options An array of options * @param array $attributes An array of default HTML attributes * * @see sfWidgetFormChoice */ protected function configure($options = array(), $attributes = array()) { parent::configure($options, $attributes); $this->addOption('culture'); $this->addOption('add_empty', false); $culture = isset($options['culture']) ? $options['culture'] : 'en'; $timezones = array_keys(sfCultureInfo::getInstance($culture)->getTimeZones()); $timezones = array_combine($timezones, $timezones); $addEmpty = isset($options['add_empty']) ? $options['add_empty'] : false; if (false !== $addEmpty) { $timezones = array_merge(array('' => true === $addEmpty ? '' : $addEmpty), $timezones); } $this->setOption('choices', $timezones); }
/** * Constructor. * * Available options: * * * culture: The culture to use for internationalized strings * * countries: An array of country codes to use (ISO 3166) * * add_empty: Whether to add a first empty value or not (false by default) * If the option is not a Boolean, the value will be used as the text value * * @param array $options An array of options * @param array $attributes An array of default HTML attributes * * @see sfWidgetFormChoice */ protected function configure($options = array(), $attributes = array()) { parent::configure($options, $attributes); $this->addOption('culture'); $this->addOption('countries'); $this->addOption('add_empty', false); // populate choices with all countries $culture = isset($options['culture']) ? $options['culture'] : 'en'; $countries = sfCultureInfo::getInstance($culture)->getCountries(isset($options['countries']) ? $options['countries'] : null); $addEmpty = isset($options['add_empty']) ? $options['add_empty'] : false; if (false !== $addEmpty) { $countries = array_merge(array('' => true === $addEmpty ? '' : $addEmpty), $countries); } $this->setOption('choices', $countries); }
/** * Constructor. * * Available options: * * * culture: The culture to use for internationalized strings * * languages: An array of language codes to use * * add_empty: Whether to add a first empty value or not (false by default) * If the option is not a Boolean, the value will be used as the text value * * @param array $options An array of options * @param array $attributes An array of default HTML attributes * * @see sfWidgetFormChoice */ protected function configure($options = array(), $attributes = array()) { parent::configure($options, $attributes); $this->addOption('culture'); $this->addOption('languages'); $this->addOption('add_empty', false); // populate choices with all languages $culture = isset($options['culture']) ? $options['culture'] : 'en'; $kk_lang = isset($options['languages']) == true ? $options['languages'] : null; //var_dump(sfCultureInfo::getInstance($culture)->getLanguages()); //exit; $languages = sfCultureInfo::getInstance($culture)->getLanguages(); $addEmpty = isset($options['add_empty']) ? $options['add_empty'] : false; if (false !== $addEmpty) { $languages = array_merge(array('' => true === $addEmpty ? '' : $addEmpty), $languages); } $this->setOption('choices', $languages); }
/** * Constructor. * * Available options: * * * add_empty: Whether to add a first empty value or not (false by default) * If the option is not a Boolean, the value will be used as the text value * * 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); $this->addOption('add_empty', false); $this->addOption('type', 'sigla'); switch ($this->getOption('type')) { case 'nome': $this->addOption('choices', $this->getUFNome()); break; case 'sigla+nome': $this->addOption('choices', $this->getUFNomeSigla()); break; case 'sigla': default: $this->addOption('choices', $this->getUFSigla()); break; } }
public function configure($options = array(), $attributes = array()) { parent::configure($options, $attributes); $array = range(1, 10, 1); $this->setOption('choices', array_combine($array, $array)); }
protected function configure($options = array(), $attributes = array()) { parent::configure($options, $attributes); dcWidgetFormChosenChoice::addConfigurationOptions($this); }
protected function configure($options = array(), $attributes = array()) { $this->addRequiredOption('other_id'); $this->addOption('choices', array()); parent::configure($options, $attributes); }
/** * Constructor. * * @see sfWidgetFormInput */ protected function configure($options = array(), $attributes = array()) { parent::configure($options, $attributes); }
/** * Constructor. * * Available options: * * * add_empty: Whether to add a first empty value or not (false by default) * If the option is not a Boolean, the value will be used as the text value * * @see sfWidgetFormSelect */ protected function configure($options = array(), $attributes = array()) { $this->addOption('multiple', false); $this->addOption('add_empty', false); parent::configure($options, $attributes); }
/** * Configure widget * * @param array $options An array of options [optional] * @param array $attributes An array of default HTML attributes [optional] * @return void * @author relo_san * @since february 8, 2010 * @see sfWidgetForm */ protected function configure($options = array(), $attributes = array()) { $this->addRequiredOption('url'); $this->addRequiredOption('parent'); parent::configure($options, $attributes); }
protected function configure($options = array(), $attributes = array()) { parent::configure($options, $attributes); $this->addRequiredOption('catalogue'); }
/** * @param array $options An array of options * @param array $attributes An array of default HTML attributes * * @see sfWidgetFormChoice */ protected function configure($options = array(), $attributes = array()) { parent::configure($options, $attributes); $this->setOption('multiple', true); }