addWidget('Example Widget Name', $method = 'myExampleWidget'); // $this->addWidget('Example Widget 2', $method = 'myExampleWidget', $params = array('myparam' => 'myvalue')); } /** * This method renders a widget as defined in "init()". It's on you how to generate the content of the * widget. As long as you return a string everything is fine. You can use for instance a "Piwik\View" to render a * twig template. In such a case don't forget to create a twig template (eg. myViewTemplate.twig) in the * "templates" directory of your plugin. * * @return string */ public function myExampleWidget() { // $view = new View('@ExamplePlugin/myViewTemplate'); // return $view->render(); return 'My Widget Text'; } /** * Here you can remove any widgets defined by any plugin. * * @param WidgetsList $widgetsList */ public function configureWidgetsList(WidgetsList $widgetsList) { // $widgetsList->remove('NameOfWidgetCategory'); // will remove all widgets having this category // $widgetsList->remove('NameOfWidgetCategory', 'Widget name'); // will only remove a specific widget } }