Alternatives to redirect() and render()

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?

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

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’]);

You do not have to call runAction with the full url only with ‘controller/action’.

Thx for these informations. Gave reputation points for U.

Go ahead!

This thread can be solved as successfully solved