Equivalent of "Yii::app()->runController('controller/action')" in Yii2?

Maulana Yusuf picture Maulana Yusuf · Feb 11, 2015 · Viewed 16k times · Source

What is the equivalent function of:

Yii::app()->runController('controller/action')

in Yii2? I would like to call a action from another controller in current controller.

Thanks.

Answer

Peter Kalef ' DidiSoft picture Peter Kalef ' DidiSoft · Feb 11, 2015

This may work:

Yii::$app->runAction('controller/action');