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:

Following attempt fails by getting error:

yii\base\InvalidRouteException: Unable to resolve the request: 


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