This forum has moved to a new location and is in read-only mode. Please visit to access the new location.


I followed this guide to create a widget base for backend. In this section:

$myWidget = new MyWidgetClass($this);
$myWidget->alias = 'myWidget';

. How pass a variable from controller to widget?


Last updated


in the widget $this->controller->publicFunctionName() or $this->controller->publicFieldName are options.

You can also set the config, or make a method in the widget.
The widget is a normal class, you can just do normal php stuff with it, especially if you initialise it the way you do.

class MyWidgetClass() {
    protected $myOptions = [
        'bar' =>2
   public function setOptions(array $options) {
      $this->myOptions = $options;

Last updated

1-2 of 2

You cannot edit posts or make replies: the forum has moved to