PHP Класс Piwik\Report\ReportWidgetFactory

.. When creating a widget from a report these values will be automatically specified so that ideally $factory->createWidget() is all one has to do in order to create a new widget.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__construct ( Report $report ) Generates a new report widget factory.
createContainerWidget ( string $containerId ) : WidgetContainerConfig Creates a new container widget based on the specified report in {@link construct()}.
createCustomWidget ( string $action ) : ReportWidgetConfig Creates a custom widget that doesn't use a viewDataTable to render the report but instead a custom controller action. Make sure the specified $action exists in the plugin's controller. Otherwise behaves as {@link createWidget()}.
createWidget ( ) : ReportWidgetConfig Creates a widget based on the specified report in {@link construct()}.

Описание методов

__construct() публичный Метод

Generates a new report widget factory.
public __construct ( Report $report )
$report Piwik\Plugin\Report A report instance, widgets will be created based on the data provided by this report.

createContainerWidget() публичный Метод

It will automatically use the report's categoryId, subcategoryId (if specified) and order in order to create the container.
public createContainerWidget ( string $containerId ) : WidgetContainerConfig
$containerId string eg 'Products' or 'Contents' see {Piwik\Widget\WidgetContainerConfig::setId()}. Other reports or widgets will be able to add more widgets to this container. This is useful when you want to show for example multiple related widgets together.
Результат Piwik\Widget\WidgetContainerConfig

createCustomWidget() публичный Метод

Creates a custom widget that doesn't use a viewDataTable to render the report but instead a custom controller action. Make sure the specified $action exists in the plugin's controller. Otherwise behaves as {@link createWidget()}.
public createCustomWidget ( string $action ) : ReportWidgetConfig
$action string eg 'conversionReports' (requires a method `public function conversionReports()` in the plugin's controller).
Результат ReportWidgetConfig

createWidget() публичный Метод

It will automatically use the report's name, categoryId, subcategoryId (if specified), defaultViewDataTable, module, action, order and parameters in order to create the widget.
public createWidget ( ) : ReportWidgetConfig
Результат ReportWidgetConfig