WidgetManager
in package
Uses
Singleton
Widget manager
Tags
Table of Contents
- $formWidgetCallbacks : array<string|int, mixed>
- $formWidgetHints : array<string|int, mixed>
- $formWidgets : array<string|int, mixed>
- $instance : mixed
- $pluginManager : PluginManager
- $reportWidgetCallbacks : array<string|int, mixed>
- $reportWidgets : array<string|int, mixed>
- __clone() : mixed
- __wakeup() : mixed
- forgetInstance() : mixed
- Forget this singleton's instance if it exists
- getReportWidgets() : array<string|int, mixed>
- Returns the raw array of registered report widgets.
- instance() : mixed
- Create a new instance of this singleton.
- listFormWidgets() : array<string|int, mixed>
- Returns a list of registered form widgets.
- listReportWidgets() : array<string|int, mixed>
- Returns a list of registered report widgets.
- registerFormWidget() : void
- Registers a single form widget.
- registerFormWidgets() : mixed
- Manually registers form widget for consideration. Usage:
- registerReportWidget() : mixed
- registerReportWidgets() : mixed
- Manually registers report widget for consideration. Usage:
- removeReportWidget() : void
- Remove a registered ReportWidget.
- resolveFormWidget() : string
- Returns a class name from a form widget code Normalizes a class name or converts an code to its class name.
- __construct() : mixed
- Constructor.
- init() : mixed
- Initialize this singleton.
Properties
$formWidgetCallbacks
protected
array<string|int, mixed>
$formWidgetCallbacks
= []
Cache of form widget registration callbacks.
$formWidgetHints
protected
array<string|int, mixed>
$formWidgetHints
An array of form widgets keyed by their code. Stored in the form of ['formwidgetcode' => 'FormWidgetClass'].
$formWidgets
protected
array<string|int, mixed>
$formWidgets
An array of form widgets. Stored in the form of ['FormWidgetClass' => $formWidgetInfo].
$instance
protected
static mixed
$instance
$pluginManager
protected
PluginManager
$pluginManager
$reportWidgetCallbacks
protected
array<string|int, mixed>
$reportWidgetCallbacks
= []
Cache of report widget registration callbacks.
$reportWidgets
protected
array<string|int, mixed>
$reportWidgets
An array of report widgets.
Methods
__clone()
public
__clone() : mixed
Return values
mixed —__wakeup()
public
__wakeup() : mixed
Return values
mixed —forgetInstance()
Forget this singleton's instance if it exists
public
final static forgetInstance() : mixed
Return values
mixed —getReportWidgets()
Returns the raw array of registered report widgets.
public
getReportWidgets() : array<string|int, mixed>
Return values
array<string|int, mixed> —Array keys are class names.
instance()
Create a new instance of this singleton.
public
final static instance() : mixed
Return values
mixed —listFormWidgets()
Returns a list of registered form widgets.
public
listFormWidgets() : array<string|int, mixed>
Return values
array<string|int, mixed> —Array keys are class names.
listReportWidgets()
Returns a list of registered report widgets.
public
listReportWidgets() : array<string|int, mixed>
Return values
array<string|int, mixed> —Array keys are class names.
registerFormWidget()
Registers a single form widget.
public
registerFormWidget(string $className[, array<string|int, mixed> $widgetInfo = null ]) : void
Parameters
- $className : string
-
Widget class name.
- $widgetInfo : array<string|int, mixed> = null
-
Registration information, can contain a
codekey.
Return values
void —registerFormWidgets()
Manually registers form widget for consideration. Usage:
public
registerFormWidgets(callable $definitions) : mixed
WidgetManager::registerFormWidgets(function ($manager) { $manager->registerFormWidget('Backend\FormWidgets\CodeEditor', 'codeeditor'); });
Parameters
- $definitions : callable
Return values
mixed —registerReportWidget()
public
registerReportWidget(mixed $className, mixed $widgetInfo) : mixed
Parameters
- $className : mixed
- $widgetInfo : mixed
Return values
mixed —registerReportWidgets()
Manually registers report widget for consideration. Usage:
public
registerReportWidgets(callable $definitions) : mixed
WidgetManager::registerReportWidgets(function ($manager) { $manager->registerReportWidget('RainLab\GoogleAnalytics\ReportWidgets\TrafficOverview', [ 'name' => 'Google Analytics traffic overview', 'context' => 'dashboard' ]); });
Parameters
- $definitions : callable
Return values
mixed —removeReportWidget()
Remove a registered ReportWidget.
public
removeReportWidget(string $className) : void
Parameters
- $className : string
-
Widget class name.
Return values
void —resolveFormWidget()
Returns a class name from a form widget code Normalizes a class name or converts an code to its class name.
public
resolveFormWidget(string $name) : string
Parameters
- $name : string
-
Class name or form widget code.
Return values
string —The class name resolved, or the original name.
__construct()
Constructor.
protected
final __construct() : mixed
Return values
mixed —init()
Initialize this singleton.
protected
init() : mixed