Documentation

Widgets
in package

Widget management class.

Tags
author

Samerton

version
2.2.0
license

MIT

Table of Contents

Properties

$_cache  : Cache
$_db  : DB
$_enabled  : array<string|int, mixed>
$_language  : Language
$_name  : string
$_template  : TemplateBase
$_widgets  : array<string|int, AbstractWidget>

Methods

__construct()  : mixed
add()  : void
Register a widget to the widget list.
disable()  : void
Disable a widget.
enable()  : void
Enable a widget.
getAll()  : array<string|int, AbstractWidget>
List all widgets, sorted by their order.
getName()  : string
Get the name of this collection of widgets.
getWidget()  : AbstractWidget|null
Get a widget by name.
getWidgets()  : array<string|int, mixed>
Get code for all enabled widgets on the current page.
isEnabled()  : bool
Check if widget is enabled or not.

Properties

$_enabled

private array<string|int, mixed> $_enabled = []

Methods

getName()

Get the name of this collection of widgets.

public getName() : string

Not used internally.

Return values
string

Name of this instance.

getWidget()

Get a widget by name.

public getWidget(string $name) : AbstractWidget|null
Parameters
$name : string

Name of widget to get.

Return values
AbstractWidget|null

Instance of widget with same name, null if it doesn't exist.

getWidgets()

Get code for all enabled widgets on the current page.

public getWidgets(string $location[, User|null $profile_user = null ]) : array<string|int, mixed>
Parameters
$location : string

Either left or right.

$profile_user : User|null = null

User object of the profile page.

Return values
array<string|int, mixed>

List of HTML to be displayed.

isEnabled()

Check if widget is enabled or not.

public isEnabled(AbstractWidget $widget) : bool
Parameters
$widget : AbstractWidget

Instance of widget to check.

Return values
bool

Whether this widget is enabled or not.


        
On this page

Search results