How Can I Get Current Controller And Current Controller Action

[Solved] How Can I Get Current Controller And Current Controller Action | Php Frameworks Yii - Code Explorer | yomemimo.com
Question : How can I get current controller and current controller action name in yii2

Answered by : rusik

<?php echo Yii::$app->controller->id; //current controller id ?>
<?php echo Yii::$app->controller->action->id; //current controller action id ?>

Source : https://stackoverflow.com/questions/27796371/how-can-i-get-current-controller-in-yii2 | Last Update : Thu, 02 Jun 22

Question : How can I get current controller in yii2

Answered by : rusik

Yii::$app->controller->id;

Source : https://stackoverflow.com/questions/27796371/how-can-i-get-current-controller-in-yii2 | Last Update : Thu, 02 Jun 22

Answers related to How can I get current controller and current controller action name in yii2

Code Explorer Popular Question For Php Frameworks Yii