Access parameters in standalone action

Hello, how can i access to the request parameters in a standalone action.

In inline actions, the process is automatic.

I was trying




 public function actions()

    {

        return [

            'view' => [

                'class' => 'backend\actions\ViewAction',

                'model' => '\backend\models\Alert' ,

                'actionParams' => $this->actionParams,

            ],

        ];

    }



but $this->actionParams is empty.

In the action:




$this->controller->actionParams



it is empty in your code because at that point there is no action call executed yet.

Thanks, but still not working

I change to




            'view' => [

                'class' => 'backend\actions\ViewAction',

                'model' => '\backend\models\Alert' ,

            ],



And in the ViewAction run(), the $this->controller->actionParams is also empty.

Is this a bug ?

Solved.

The parameters must be in run().




public function run($id)