How to get current controller name and action name in Yii

No Comments
$controller=Yii::app()->controller;
 
$action=$controller->action;
 
 
//Getting the current action
 
echo $action->id;
 
 
 
//Getting the current controller
 
$controller->uniqueID

Image Credits: Photo by Isis França on Unsplash.

Last Updated On March 22, 2018

Related Articles

No results found

Leave a Reply

avatar
  Subscribe  
Notify of
Menu
Copy link