symfony API

sfWidgetFormDateTime Class

You are currently browsing
the website for symfony 1

Visit the Symfony2 website


« Back to API menu

1.3 API OpenSearch

Packages

You are currently browsing the symfony API for the 1.3 version. Switch to:

sfWidgetFormDateTime represents a datetime widget.

Inheritence

sfWidgetFormI18nDateTime  <  sfWidgetFormDateTime  <  sfWidgetForm < sfWidget

Method Summary

  • configure($options, $attributes)
    Configures the current widget.
  • array getAttributesFor($type, $attributes)
    Returns an array of HTML attributes for the given type.
  • sfWidgetForm getDateWidget($attributes)
    Returns the date widget.
  • array getOptionsFor($type)
    Returns an array of options for the given type.
  • sfWidgetForm getTimeWidget($attributes)
    Returns the time widget.
  • string render($name, $value, $attributes, $errors)
    Renders the widget.

Methods inherited from sfWidgetForm

fixFormId , generateId , generateTwoCharsRange , getDefault , getIdFormat , getLabel , getParent , isHidden , needsMultipartForm , renderContentTag , renderTag , setDefault , setHidden , setIdFormat , setLabel , setParent , translate , translateAll , __construct

Methods inherited from sfWidget

addOption , addRequiredOption , attributesToHtml , attributesToHtmlCallback , configure , escapeOnce , fixDoubleEscape , getAttribute , getAttributes , getCharset , getJavaScripts , getOption , getOptions , getRequiredOptions , getStylesheets , hasOption , isXhtml , render , renderContentTag , renderTag , setAttribute , setAttributes , setCharset , setOption , setOptions , setXhtml , __construct

Method Details

  • configure ($options, $attributes) Browse code

    $options An array of options
    $attributes An array of default HTML attributes

    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:

    * date: Options for the date widget (see sfWidgetFormDate)
    * time: Options for the time widget (see sfWidgetFormTime)
    * with_time: Whether to include time (true by default)
    * format: The format string for the date and the time widget (default to %date% %time%)

  • (array) getAttributesFor ($type, $attributes) Browse code

    $type The type (date or time)
    $attributes An array of attributes

    Returns an array of HTML attributes for the given type.

    returns An array of HTML attributes

  • (sfWidgetForm) getDateWidget ($attributes) Browse code

    $attributes An array of attributes

    Returns the date widget.

    returns A Widget representing the date

  • (array) getOptionsFor ($type) Browse code

    $type The type (date or time)

    Returns an array of options for the given type.

    returns An array of options

    throws InvalidArgumentException when option date|time type is not array

  • (sfWidgetForm) getTimeWidget ($attributes) Browse code

    $attributes An array of attributes

    Returns the time widget.

    returns A Widget representing the time

  • (string) render ($name, $value, $attributes, $errors) Browse code

    $name The element name
    $value The date and time displayed in this widget
    $attributes An array of HTML attributes to be merged with the default HTML attributes
    $errors An array of errors for the field

    Renders the widget.

    returns An HTML tag string