Class humhub\widgets\BaseStack

Inheritancehumhub\widgets\BaseStack » humhub\components\Widget » yii\base\Widget
Subclasseshumhub\modules\content\widgets\WallEntryAddons, humhub\modules\content\widgets\WallEntryLinks, humhub\modules\dashboard\widgets\Sidebar, humhub\modules\directory\widgets\Sidebar, humhub\modules\space\widgets\HeaderControls, humhub\modules\space\widgets\Sidebar, humhub\modules\user\widgets\ProfileHeaderControls, humhub\modules\user\widgets\ProfileSidebar, humhub\widgets\BaseSidebar, humhub\widgets\LayoutAddons, humhub\widgets\NotificationArea, humhub\widgets\TopMenuRightStack
Available since version0.5

StackWidget is a widget which can hold a set of subwidgets.

This is mainly used to build e.g. sidebars. It allows adding or removing other widgets by events.

Public Methods

Hide inherited methods

MethodDescriptionDefined By
addWidget() Adds a new widget humhub\widgets\BaseStack
getLayoutViewParams() Returns an array of view parameter used if \humhub\components\layout is set. humhub\components\Widget
init() Initializes the sidebar widget. humhub\widgets\BaseStack
process() Process is a wrapper for the run method humhub\components\Widget
removeWidget() Removes a widget from the stack humhub\widgets\BaseStack
run() Runs the Navigation humhub\widgets\BaseStack
widget() Creates a widget instance and runs it. humhub\components\Widget

Protected Methods

Hide inherited methods

MethodDescriptionDefined By
getWidgets() Returns all widgets by sortorder humhub\widgets\BaseStack

Events

Hide inherited events

EventTypeDescriptionDefined By
EVENT_CREATE humhub\libs\WidgetCreateEvent An event raised before creating a widget. humhub\components\Widget

Constants

Hide inherited constants

ConstantValueDescriptionDefined By
EVENT_INIT 'init' humhub\widgets\BaseStack
EVENT_RUN 'run' humhub\widgets\BaseStack

Property Details

$seperator public property
public string $seperator ''
$template public property
public string $template '{content}'
$widgets public property
public array $widgets = []

Method Details

addWidget() public method

Adds a new widget

public void addWidget ( $className, $params = [], $options = [] )
$className string
$params array

Widget definition

$options array

Extra option array with e.g. "sortOrder"

getWidgets() protected method

Returns all widgets by sortorder

protected array getWidgets ( )
init() public method

Initializes the sidebar widget.

public void init ( )
removeWidget() public method

Removes a widget from the stack

public void removeWidget ( $className )
$className string
run() public method

Runs the Navigation

public void run ( )