Static Public Member Functions | |
static | set_show_chrome ($with_chrome) |
Set to true to render the widget with chrome, ie the settings and titlebar Set to false to only render the content. | |
static | add_widgets ($page, $widgets, $master) |
Render all the widgets in $widgets in the proper order for $page. | |
static | add ($widget_obj, $master) |
Given a widget model object and a parent object, add the widget's resources to the parent object and return a string rendering of the widget. | |
static | get ($widget_obj) |
Given a widget model object, return an instance of the widget class. | |
static | set_resources ($widget, $master) |
Extract the external resources from the widget and provides them to the master. |
widget helper class.
static widget::add | ( | $ | widget_obj, | |
$ | master | |||
) | [static] |
Given a widget model object and a parent object, add the widget's resources to the parent object and return a string rendering of the widget.
In other words, this does the combination of get and set_resources, with some extra error handling.
Also see add_widgets method, which is probably what you want.
$widget_obj | A widget model object to render | |
$master | The parent object to set resources on |
static widget::add_widgets | ( | $ | page, | |
$ | widgets, | |||
$ | master | |||
) | [static] |
Render all the widgets in $widgets in the proper order for $page.
Set the widgets' resources to $master.
$page | The name of the page to use ordering from | |
$widgets | A list of ninja widget model objects | |
$master | A parent container, often the caller |
static widget::get | ( | $ | widget_obj | ) | [static] |
static widget::set_resources | ( | $ | widget, | |
$ | master | |||
) | [static] |
Extract the external resources from the widget and provides them to the master.
The master will have the resources assigned to it's xtra_js, xtra_css and inline_js properties.
Also see the add method, which is probably what you want.
$widget | A widget object | |
$master | Generally the caller controller, which will then have to provide this to their template |
static widget::set_show_chrome | ( | $ | with_chrome | ) | [static] |
Set to true to render the widget with chrome, ie the settings and titlebar Set to false to only render the content.
$with_chrome | boolean Whether to show chrome or not |