option Class Reference
A model used by widgets to render their custom configuration options.
More...
Public Member Functions |
| __construct ($ns, $name, $label, $type, $args=array(), $default=0) |
| Constructor.
|
| is_hidden () |
| set_help ($key, $controller) |
| should_render_js ($render_js) |
| True to auto-render javascript to handle changes, false otherwise.
|
| value ($settings) |
| Get the value for the setting.
|
| render_label ($id) |
| Print the label tag.
|
| render_widget ($id, $settings) |
| Print the widget itself.
|
| render_js () |
| Returns the javascript to handle option changes Will return the empty string if should_render_js is false.
|
| render_help () |
Data Fields |
| $ns |
| A unique namespace, usually the widget name.
|
| $name |
| A field name, should be "code-friendly".
|
| $label |
| The label text, should be translated.
|
Detailed Description
A model used by widgets to render their custom configuration options.
Constructor & Destructor Documentation
option::__construct |
( |
$ |
ns, |
|
|
$ |
name, |
|
|
$ |
label, |
|
|
$ |
type, |
|
|
$ |
args = array() , |
|
|
$ |
default = 0 | |
|
) |
| | |
Constructor.
- Parameters:
-
| $ns | A unique namespace for the options, usually the widget name |
| $name | A field name, should be "code-friendly" so lower-case ascii and no spaces |
| $label | A (translated) label to print |
| $type | The widget type, ie "input", "checkbox", "textarea", etc - must exist in kohana's form helper |
| $args | An attribute-value map that will be added to the widget |
| $default | Default value for the widget |
Member Function Documentation
option::render_label |
( |
$ |
id |
) |
|
Print the label tag.
- Parameters:
-
| $id | Instance id for this widget |
option::render_widget |
( |
$ |
id, |
|
|
$ |
settings | |
|
) |
| | |
Print the widget itself.
- Parameters:
-
| $id | Instance id for this widget |
| $settings | Settings from a widget model object |
option::set_help |
( |
$ |
key, |
|
|
$ |
controller | |
|
) |
| | |
- Parameters:
-
| $key | string |
| $controller | string |
option::value |
( |
$ |
settings |
) |
|
Get the value for the setting.
- Parameters:
-
| $settings | Settings from a widget model object |
- Returns:
- The setting if set, otherwise the default value
The documentation for this class was generated from the following file: