jneto
(Joel Neto)
1
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.
CeBe
2
In the action:
$this->controller->actionParams
it is empty in your code because at that point there is no action call executed yet.
jneto
(Joel Neto)
3
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.
jneto
(Joel Neto)
5
Solved.
The parameters must be in run().
public function run($id)