How to get current controller name and action name in Yii

5 sec read

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

Last Updated On March 22, 2018

Leave a Reply

avatar
  Subscribe  
Notify of