tklustig
(Kipp Thomas)
March 19, 2018, 4:03pm
1
Hi guys,
a short question:
Are there any alternatives using yii2-methods redirect() respectively render()?
My intention is running another actionMethod from Controller B called by Controller A giving arrays as parameter without using sessions
What is recommended way to do this?
yiim
March 19, 2018, 7:55pm
2
You can call any action in the same or a different controller with runaction and optional parameters:
https://stackoverflow.com/questions/33061819/how-to-get-params-in-action-passed-via-runaction-in-yii2
tklustig
(Kipp Thomas)
March 20, 2018, 1:45pm
3
Following attempt fails by getting error:
yii\base\InvalidRouteException: Unable to resolve the request:
bewerber/bewerber//yii2_perswitch/frontend/web/yiic.php/mail_ausgang_stapelmail
in D:\xampp\htdocs\yii2_perswitch\vendor\yiisoft\yii2\base\Controller.php:128
$url = \yii\helpers\Url::to(['/mail/mail-ausgang/stapelmail']);
return $this->runAction($url);
Note,that Controller calling method runAction has follwonig Url:
$Actualurl = \yii\helpers\Url::to([’/bewerber/bewerber/indexl’]);
yiim
March 20, 2018, 5:10pm
4
You do not have to call runAction with the full url only with ‘controller/action’.
tklustig
(Kipp Thomas)
March 22, 2018, 9:43am
5
Thx for these informations. Gave reputation points for U.
Go ahead!
This thread can be solved as successfully solved