widget Class Reference

widget helper class. More...

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.

Detailed Description

widget helper class.


Member Function Documentation

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.

Parameters:
$widget_obj A widget model object to render
$master The parent object to set resources on
Returns:
string The rendered widget output
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.

Parameters:
$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
Returns:
An array of the placeholders, and the rendered widgets therein
static widget::get ( widget_obj  )  [static]

Given a widget model object, return an instance of the widget class.

Also see the add method, which is probably what you want.

Parameters:
$widget_obj The widget model object
Returns:
An instance of the widget class
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.

Parameters:
$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.

Parameters:
$with_chrome boolean Whether to show chrome or not

The documentation for this class was generated from the following file:
 All Data Structures Functions Variables

Generated on 19 Dec 2018 for ninja by  doxygen 1.6.1