I'm trying to get current page controller in yii2? How can I achieve this in Yii2?
In Yii 1.0
Yii::app()->controller->action->id
Yii2 ?
CController manages a set of actions which deal with the corresponding user requests. Through the actions, CController coordinates the data flow between models and views.
use this code
Yii::$app->controller->id
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With