Loading…

How we can get current controller & action name in Yii?

You can get the current controller name by:
//Controller Name
echo Yii::$app->controller->id;

You can get current action name by:
echo Yii::$app->controller->action->id;

Suggest An Answer

No suggestions avaliable!

Latest post from YII Interview Questions

Ask Question