sfWidgetFormChoice represents a choice widget.
Method Summary
-
configure($options, $attributes)
Constructor.
-
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, $attributes, $errors)
Renders the widget.
-
setIdFormat($format)
Sets the format for HTML id attributes. This is made avaiable to the renderer,
configure , getChoices , __clone
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 |
Constructor.
Available options: * 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, $attributes, $errors)
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 |
Renders the widget.
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.
|