How to get current action & controller name in yii2?
Answer / 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 |
What is name of first file the loaded when yii 2.0 framework starts?
Explain naming convention in yii 2 framework?
What is yii?
What is name of first file the loaded when yii framework starts?
In yii, how to get ip address?
Why gii is used?
Why use yii 2.0 framework?
How to access module component?
How to configure yii application with database?
What are the application structure of yii 2.0 framework?
List some database related query functions in yii?
What are the core components of yii2 framework?