Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


How to get current action & controller name in yii2?



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

Post New Answer

More Yii PHP Framework Interview Questions

What is name of first file the loaded when yii 2.0 framework starts?

1 Answers  


Explain naming convention in yii 2 framework?

1 Answers  


What is yii?

1 Answers  


What is name of first file the loaded when yii framework starts?

1 Answers  


In yii, how to get ip address?

1 Answers  


Why gii is used?

1 Answers  


Why use yii 2.0 framework?

1 Answers  


How to access module component?

1 Answers  


How to configure yii application with database?

1 Answers  


What are the application structure of yii 2.0 framework?

1 Answers  


List some database related query functions in yii?

1 Answers  


What are the core components of yii2 framework?

1 Answers  


Categories