Answer Posted / Aneer Yadav
In Yii2, you can use the following code to get the current action and controller names:
```php
$controllerId = Yii::$app->controller->id;
$actionId = Yii::$app->controller->action->id;
```
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers