createCustomWidget() public method

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).
return ReportWidgetConfig
Exemplo n.º 1
0
 public function configureWidgets(WidgetsList $widgetsList, ReportWidgetFactory $factory)
 {
     $widgetsList->addWidgetConfig($factory->createWidget()->setName('Referrers_ReferrerTypes')->setSubcategoryId('Referrers_WidgetGetAll'));
     $widgetsList->addWidgetConfig($factory->createWidget()->setName('General_EvolutionOverPeriod')->setSubcategoryId('General_Overview')->setAction('getEvolutionGraph')->setOrder(9)->setIsNotWidgetizable()->forceViewDataTable(Evolution::ID)->addParameters(array('columns' => $defaultColumns = array('nb_visits'))));
     $widgetsList->addWidgetConfig($factory->createCustomWidget('getSparklines')->forceViewDataTable(Sparklines::ID)->setIsNotWidgetizable()->setName('Referrers_Type')->setSubcategoryId('General_Overview')->setOrder(10));
 }