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 are the core application components available on yii?

1 Answers  


What is gii in yii 2.0 and why it is used?

1 Answers  


What are the requirements of the yii?

1 Answers  


Explain the difference between homeurl and baseurl in yii2?

1 Answers  


What is required properties in yii application? Why?

1 Answers  


What is components in yii?

1 Answers  


What are the type of models available in yii framework ?

1 Answers  


What is yii 2?

1 Answers  


How do we extend yii?

1 Answers  


How to get current controller id in yii ?

1 Answers  


What is cactiverecord in yii framework ?

1 Answers  


How to use module components and aliases?

1 Answers  


Categories