Home Yii Framework How to get current controller name and action name in Yii?
 
 
 

How to get current controller name and action name in Yii?

PDF Print E-mail

Question: How to get current controller name and action name in Yii?

 

Answer:

 
 
$controller=Yii::app()->controller;
 
$action=$controller->action;
 
 
//Getting the current action
 
echo $action->id;
 
 
 
//Getting the current controller
 
$controller->uniqueID
 
 
 
+/-
+/- Write comment
Your Contact Details:
Comment:
[b] [i] [u] [url] [quote] [code] [img]   
Security Please input the anti-spam code that you can read in the image.
 

Go Daddy $7.49 .com Sale!