Class humhub\components\Widget
Public Properties
Property | Type | Description | Defined By |
---|---|---|---|
$render | boolean | If set to false this widget won't be rendered | humhub\components\Widget |
$widgetLayout | string | Defines an optional layout | humhub\components\Widget |
Public Methods
Method | Description | Defined By |
---|---|---|
getLayoutViewParams() | Returns an array of view parameter used if \humhub\components\layout is set. | humhub\components\Widget |
process() | Process is a wrapper for the run method | humhub\components\Widget |
widget() | Creates a widget instance and runs it. | humhub\components\Widget |
Events
Event | Type | Description | Defined By |
---|---|---|---|
EVENT_CREATE | humhub\libs\WidgetCreateEvent | An event raised before creating a widget. | humhub\components\Widget |
Property Details
If set to false this widget won't be rendered
Defines an optional layout
Method Details
Returns an array of view parameter used if \humhub\components\layout is set.
By default the actual widget output created by \humhub\components\run() is set as content
param.
public array getLayoutViewParams ( ) |
Process is a wrapper for the run method
public void process ( ) |
Creates a widget instance and runs it.
The widget rendering result is returned by this method.
public static string widget ( $config = [] ) | ||
$config | array | Name-value pairs that will be used to initialize the object properties |
return | string | The rendering result of the widget. |
---|---|---|
throws | Exception |
Event Details
An event raised before creating a widget.