-
(sfWidget) addOption ($name, $value)
Browse code
| $name |
The option name |
| $value |
The default value |
Adds a new option value with a default value.
returns The current widget instance
-
(sfWidget) addRequiredOption ($name)
Browse code
Adds a required option.
returns The current widget instance
-
(string) attributesToHtml ($attributes)
Browse code
| $attributes |
An array of attributes |
Converts an array of attributes to its HTML representation.
returns The HTML representation of the HTML attribute array.
-
(string) attributesToHtmlCallback ($k, $v)
Browse code
| $k |
The attribute key |
| $v |
The attribute value |
Prepares an attribute key and value for HTML representation.
It removes empty attributes, except for the value one.
returns The HTML representation of the HTML key attribute pair.
-
configure ($options, $attributes)
Browse code
| $options |
An array of options |
| $attributes |
An array of HTML attributes |
Configures the current widget.
This method allows each widget to add options or HTML attributes
during widget creation.
If some options and HTML attributes are given in the sfWidget constructor
they will take precedence over the options and HTML attributes you configure
in this method.
-
(string) escapeOnce ($value)
Browse code
Escapes a string.
returns escaped string
-
(string) fixDoubleEscape ($escaped)
Browse code
Fixes double escaped strings.
returns single escaped string
-
(string) getAttribute ($name)
Browse code
| $name |
The attribute name. |
Returns the HTML attribute value for a given attribute name.
returns The attribute value, or null if the attribute does not exist
-
Returns the default HTML attributes.
-
(string) getCharset ()
Browse code
Returns the charset to use when rendering widgets.
returns The charset (defaults to UTF-8)
-
(array) getJavaScripts ()
Browse code
Gets the JavaScript paths associated with the widget.
returns An array of JavaScript paths
-
(mixed) getOption ($name)
Browse code
Gets an option value.
returns The option value
-
Gets all options.
returns An array of named options
-
(array) getRequiredOptions ()
Browse code
Returns all required option names.
returns An array of required option names
-
(array) getStylesheets ()
Browse code
Gets the stylesheet paths associated with the widget.
The array keys are files and values are the media names (separated by a ,):
array('/path/to/file.css' => 'all', '/another/file.css' => 'screen,print')
returns An array of stylesheet paths
-
(bool) hasOption ($name)
Browse code
Returns true if the option exists.
returns true if the option exists, false otherwise
-
Returns whether to generate XHTML tags or not.
returns true if widgets must be generated as XHTML, false otherwise
-
(string) render ($name, $value, $attributes, $errors)
Browse code
| $name |
The name of the HTML widget |
| $value |
The value of the widget |
| $attributes |
An array of HTML attributes |
| $errors |
An array of errors |
Renders the widget as HTML.
All subclasses must implement this method.
returns A HTML representation of the widget
-
renderContentTag ($tag, $content, $attributes, )
Browse code
| $tag |
The tag name |
| $content |
The content of the tag |
| $attributes |
An array of HTML attributes to be merged with the default HTML attributes |
Renders a HTML content tag.
-
renderTag ($tag, $attributes, )
Browse code
| $tag |
The tag name |
| $attributes |
An array of HTML attributes to be merged with the default HTML attributes |
Renders a HTML tag.
-
(sfWidget) setAttribute ($name, $value)
Browse code
| $name |
The attribute name |
| $value |
The attribute value |
Sets a default HTML attribute.
returns The current widget instance
-
(sfWidget) setAttributes ($attributes)
Browse code
| $attributes |
An array of HTML attributes |
Sets the HTML attributes.
returns The current widget instance
-
Sets the charset to use when rendering widgets.
-
(sfWidget) setOption ($name, $value)
Browse code
| $name |
The option name |
| $value |
The value |
Changes an option value.
returns The current widget instance
throws InvalidArgumentException when a option is not supported
-
(sfWidget) setOptions ($options)
Browse code
| $options |
An array of options |
Sets the options.
returns The current widget instance
-
| $boolean |
true if widgets must be generated as XHTML, false otherwise |
Sets the XHTML generation flag.
-
__construct ($options, $attributes)
Browse code
| $options |
An array of options |
| $attributes |
An array of default HTML attributes |
Constructor.
throws InvalidArgumentException when a option is not supported