sfWidgetFormDateTime represents a datetime widget.
Method Summary
-
configure($options = array(), $attributes = array())
Configures the current widget.
-
array
getAttributesFor($type, $attributes)
Returns an array of HTML attributes for the given type.
-
getDateWidget($attributes = array())
Returns the date widget.
-
array
getOptionsFor($type)
Returns an array of options for the given type.
-
getTimeWidget($attributes = array())
Returns the time widget.
-
string
render($name, $value = null, $attributes = array(), $errors = array())
fixFormId , generateId , generateTwoCharsRange , getDefault , getIdFormat , getLabel , isHidden , needsMultipartForm , renderContentTag , renderTag , setDefault , setHidden , setIdFormat , setLabel , __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 = array(), $attributes = array())
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
-
getDateWidget ($attributes = array())
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
-
getTimeWidget ($attributes = array())
Browse code
| $attributes |
An array of attributes
|
Returns the time widget.
returns A Widget representing the time
-
(string) render ($name, $value = null, $attributes = array(), $errors = array())
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
|
returns An HTML tag string
|