Backend\Classes\WidgetManager\HasReportWidgets


Protected Properties

protected array $reportWidgets

protected array $reportWidgetCallbacks

reportWidgetCallbacks cache


Public Methods

public getReportWidgets()

public getReportWidgets(): array 

getReportWidgets returns the raw array of registered report widgets.

public listReportWidgets()

public listReportWidgets(): array 

listReportWidgets returns a list of registered report widgets.

public registerReportWidget()

public registerReportWidget($className, $widgetInfo): void

public registerReportWidgets()

public registerReportWidgets($definitions): void

registerReportWidgets manually registers report widget for consideration. Usage:

WidgetManager::registerReportWidgets(function ($manager) {
    $manager->registerReportWidget(\RainLab\GoogleAnalytics\ReportWidgets\TrafficOverview::class, [
        'name' => 'Google Analytics traffic overview',
        'context' => 'dashboard'
    ]);
});

public removeReportWidget()

public removeReportWidget(string $className): void 

removeReportWidget removes a registered ReportWidget.