本文整理汇总了PHP中sfWidgetForm类的典型用法代码示例。如果您正苦于以下问题:PHP sfWidgetForm类的具体用法?PHP sfWidgetForm怎么用?PHP sfWidgetForm使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了sfWidgetForm类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: configure
/**
* Configures the current widget.
*
* @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())
{
parent::configure($options, $attributes);
$this->addOption('image', false);
$this->addOption('date_widget', new sfWidgetFormDate());
$this->addOption('time_widget', new sfWidgetFormTime());
}
示例2: configure
protected function configure($options = array(), $attributes = array())
{
parent::configure($options, $attributes);
$this->addOption('from_date');
$this->addOption('to_date');
if (LeavePeriodService::getLeavePeriodStatus() == LeavePeriodService::LEAVE_PERIOD_STATUS_FORCED) {
$this->addOption('choices', null);
$this->addOption('from_label', '');
$this->addOption('to_label', '');
$this->addOption('leave_period', '');
$this->addOption('from_label_template', "");
$this->addOption('to_label_template', "");
$this->addOption('template', '%leave_period% %from_date% %to_date%');
$this->setOption('from_date', new sfWidgetFormInputHidden(array(), array('id' => 'date_from')));
$this->setOption('to_date', new sfWidgetFormInputHidden(array(), array('id' => 'date_to')));
$this->setOption('leave_period', new sfWidgetFormChoice(array('choices' => array()), array('id' => 'period')));
} else {
$this->addOption('from_label', '');
$this->addOption('to_label', 'to');
$this->addOption('from_label_template', "<label for='%from_id%' class='date_range_label'>%from_label%</label>");
$this->addOption('to_label_template', "<label for='%to_id%' class='date_range_label'>%to_label%</label>");
$this->addOption('template', '%from_label% %from_date% %to_label% %to_date%');
$this->setOption('from_date', new ohrmWidgetDatePicker(array(), array('id' => 'date_from')));
$this->setOption('to_date', new ohrmWidgetDatePicker(array(), array('id' => 'date_to')));
}
}
示例3: configure
protected function configure($options = array(), $attributes = array()) {
$this->addOption('image', false);
$this->addOption('include_time', false);
$this->addOption('date_widget', new sfWidgetFormInput());
parent::configure($options, $attributes);
}
开发者ID:romankallweit,项目名称:swingmachine,代码行数:7,代码来源:sfWidgetFormTextDateInputJQueryDatePicker.class.php
示例4: __construct
/**
* Constructor.
*
* Available options:
*
* * public_key: Your reCAPTCHA public key (app_recaptcha_private_key by default)
* * error: A reCAPTCHA error code
* * use_ssl: Use a secure connection (false by default)
*
* @param array $options An array of options
* @param array $messages An array of error messages
*
* @see sfWidgetForm
*/
public function __construct($options = array(), $attributes = array())
{
$this->addOption('public_key', sfConfig::get('app_recaptcha_public_key'));
$this->addOption('error', null);
$this->addOption('use_ssl', false);
parent::__construct($options, $attributes);
}
示例5: configure
public function configure($options = array(), $attributes = array())
{
parent::configure($options, $attributes);
$this->addOption('prefix_widget', new sfWidgetFormInput(array(), array('class' => 'mtWidgetFormCuilPrefix')));
$this->addOption('middle_widget', new sfWidgetFormInput(array(), array('class' => 'mtWidgetFormCuilMiddle')));
$this->addOption('suffix_widget', new sfWidgetFormInput(array(), array('class' => 'mtWidgetFormCuilSuffix')));
$this->addOption('separator', '-');
}
示例6: configure
/**
* Constructor.
*
* Available options:
*
* * format: The time format string (%hour%:%minute%)
* * hours: An array of hours for the hour select tag (optional)
* * minutes: An array of minutes for the minute select tag (optional)
* * can_be_empty: Whether the widget accept an empty value (true by default)
* * empty_value: String to use as empty value
*
* @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('format', '%hour%:%minute%');
$this->addOption('hours', parent::generateTwoCharsRange(0, 23));
$this->addOption('minutes', array('00', '15', '30', '45'));
$this->addOption('can_be_empty', true);
$this->addOption('empty_value', '');
}
示例7: configure
/**
* @param array $options An array of options
* @param array $attributes An array of default HTML attributes
*
* @see sfWidgetFormInput
*/
protected function configure($options = array(), $attributes = array())
{
parent::configure($options, $attributes);
$this->addOption('partial');
$this->addOption('buttons', array('add_file' => 'Add files...', 'upload' => 'Start upload', 'cancel' => 'Cancel upload'));
$this->addOption('module_partial', false);
$this->addOption('include_js', false);
}
示例8: configure
/**
* Configures the current widget.
*
* The attributes are passed to both the date and the time widget.
*
* If you want to pass HTML attributes to one of the two widget, pass an
* attributes option to the date or time option (see below).
*
* Available options:
*
* * format_date: The format string in js and php for date. (see http://docs.jquery.com/UI/Datepicker/formatDate) (see http://www.php.net/date)
* * date: Options for the date widget (see sfWidgetFormDate)
* * hours: Options for the hours widget (see sfWidgetFormChoice)
* * minutes: Options for the minutes widget (see sfWidgetFormChoice)
* * period: Options for the period widget (see sfWidgetFormChoice)
* * format: The format string for the datetime widget (default to %date% %hours% %minutes% %period%)
*
* @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('format_date', array('js' => 'ISO_8601', 'php' => 'Y-m-d H:i:s'));
$this->addOption('date', array());
$this->addOption('hours', array('choices' => parent::generateTwoCharsRange(1, 12)));
$this->addOption('minutes', array('choices' => parent::generateTwoCharsRange(0, 59)));
$this->addOption('period', array('choices' => array('AM' => 'AM', 'noon' => 'Noon', 'PM' => 'PM', 'midnight' => 'Midnight')));
$this->addOption('format', '%date% %hours% %minutes% %period%');
}
示例9: configure
/**
* @param array $options An array of options
* @param array $attributes An array of default HTML attributes
*
* @see sfWidgetFormInput
*
*
* In reality builds an array of two controls using the [] form field
* name syntax
*/
protected function configure($options = array(), $attributes = array())
{
parent::configure($options, $attributes);
$this->addOption('type', 'file');
$this->addOption('existing-html', false);
$this->addOption('image-preview', null);
$this->addOption('default-preview', null);
$this->setOption('needs_multipart', true);
}
示例10: configure
protected function configure($options = array(), $attributes = array())
{
$attributes['size'] = "5";
$attributes['maxlength'] = "5";
$this->addOption('time_widget', new sfWidgetFormInput(array(), $attributes));
$this->addOption('start_stop', false);
$this->addOption('interval', false);
parent::configure($options, $attributes);
}
开发者ID:nidhhoggr,项目名称:sfSelectTimeInputJQueryTimePickerPlugin,代码行数:9,代码来源:sfWidgetFormSelectTimeInputJQueryTimePicker.class.php
示例11: __construct
/**
* Constructor.
*
* @param array $options An array of options
* @param array $attributes An array of default HTML attributes
*
* @see sfWidgetForm
*/
public function __construct($options = array(), $attributes = array())
{
$this->addRequiredOption('widget');
$this->addOption('is_edit_public_flag', false);
$this->addOption('public_flag_default', 1);
$this->addOption('template', '%input%<br>%public_flag%');
parent::__construct($options, $attributes);
$this->setLabel($this->getOption('widget')->getLabel());
}
示例12: configure
/**
* Configures the current widget.
*
* Available options:
*
* * format: The date format string (%month%/%day%/%year% by default)
* * years: An array of years for the year select tag (optional)
* * months: An array of months for the month select tag (optional)
* * days: An array of days for the day select tag (optional)
* * can_be_empty: Whether the widget accept an empty value (true by default)
* * empty_values: An array of values to use for the empty value (empty string for year, month, and date by default)
*
* @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('format', '%month%/%day%/%year%');
$this->addOption('days', parent::generateTwoCharsRange(1, 31));
$this->addOption('months', parent::generateTwoCharsRange(1, 12));
$years = range(date('Y') - 5, date('Y') + 5);
$this->addOption('years', array_combine($years, $years));
$this->addOption('can_be_empty', true);
$this->addOption('empty_values', array('year' => '', 'month' => '', 'day' => ''));
}
示例13: configure
/**
* Constructor.
*
* Available options:
*
* * format: The time format string (%hour%:%minute%:%second%)
* * format_without_seconds: The time format string without seconds (%hour%:%minute%)
* * with_seconds: Whether to include a select for seconds (false by default)
* * hours: An array of hours for the hour select tag (optional)
* * minutes: An array of minutes for the minute select tag (optional)
* * seconds: An array of seconds for the second select tag (optional)
* * can_be_empty: Whether the widget accept an empty value (true by default)
* * empty_values: An array of values to use for the empty value (empty string for hours, minutes, and seconds by default)
*
* @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('format', '%hour%:%minute%:%second%');
$this->addOption('format_without_seconds', '%hour%:%minute%');
$this->addOption('with_seconds', false);
$this->addOption('hours', parent::generateTwoCharsRange(0, 23));
$this->addOption('minutes', parent::generateTwoCharsRange(0, 59));
$this->addOption('seconds', parent::generateTwoCharsRange(0, 59));
$this->addOption('can_be_empty', true);
$this->addOption('empty_values', array('hour' => '', 'minute' => '', 'second' => ''));
}
示例14: configure
public function configure($options = array(), $attributes = array())
{
parent::configure($options, $attributes);
/* Options used to create the embedded form */
$this->addRequiredOption('form_creation_method');
$this->addRequiredOption('edit_form_creation_method');
$this->addRequiredOption('child_form_name');
$this->addOption('child_form_title_method', '');
$this->addOption('title', '');
$this->addOption('form_creation_method_params', array());
$this->addOption('form_formatter', 'table');
$this->addOption('renderer_class', 'mtWidgetFormEmbedRenderer');
/* Options used to update the parent form */
$this->addRequiredOption('parent_form');
/* Initial object */
$this->addRequiredOption('objects');
/* Format options */
$this->addOption('toolbar-add', true);
$this->addOption('toolbar-add-image', '/dcFormExtraPlugin/images/plus.png');
$this->addOption('toolbar-add-text', 'add');
$this->addOption('toolbar-clean', true);
$this->addOption('toolbar-clean-text', 'clean');
$this->addOption('toolbar-clean-image', '/dcFormExtraPlugin/images/clean.png');
$this->addOption('toolbar-reset', true);
$this->addOption('toolbar-reset-text', 'reset');
$this->addOption('toolbar-reset-image', '/dcFormExtraPlugin/images/update.png');
$this->addOption('delete-button-image', '/dcFormExtraPlugin/images/close-action.png');
$this->addOption('delete-button-text', 'delete');
}
示例15: configure
/**
* options:
* * form: Required sfForm instance rendered by this widget
* * archiver: provide an archiver to sanitize results into a specific format (XML, YAML, etc). Default is array.
* * global_attributes: if specified, attributes are passed as if to a widget. Apply to ALL widgets
*
* @param string $options
* @param string $attributes
* @return null
* @author Brent Shaffer
*/
public function configure($options = array(), $attributes = array())
{
$this->addRequiredOption('form');
$this->addOption('archiver');
$this->addOption('global_attributes', true);
return parent::configure($options, $attributes);
}