- Published on
How to get current controller name and action name
- Authors
- Name
- Bal Singh
In view file
$this->uniqueid or $this->getUniqueId() (controller name)
$this->action->Id (action name)
In other files
Yii::app()->controller->id or $this->getUniqueId() (controller name)
Yii::app()->controller->action->id (action name)