sfWidgetFormChoice represents a choice widget.
Method Summary
-
configure($options = array(), $attributes = array())
Constructor.
-
getChoices()
-
array
getJavaScripts()
Gets the JavaScript paths associated with the widget.
-
getRenderer()
-
array
getStylesheets()
Gets the stylesheet paths associated with the widget.
-
string
render($name, $value = null, $attributes = array(), $errors = array())
-
setIdFormat($format)
Sets the format for HTML id attributes. This is made avaiable to the
renderer, as this widget does not render itself, but delegates to the
renderer instead.
-
__clone()
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
|
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')
-
-
(array) getJavaScripts ()
Browse code
Gets the JavaScript paths associated with the widget.
returns An array of JavaScript paths
-
-
(array) getStylesheets ()
Browse code
Gets the stylesheet paths associated with the widget.
returns An array of stylesheet paths
-
(string) render ($name, $value = null, $attributes = array(), $errors = array())
Browse code
| $name |
The element name
|
| $value |
The value selected 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
-
| $format |
The format string (must contain a %s for the id placeholder)
|
Sets the format for HTML id attributes. This is made avaiable to the
renderer, as this widget does not render itself, but delegates to the
renderer instead.
-
|