Published on

How to get current controller name and action name

Authors
  • avatar
    Name
    Bal Singh
    Twitter

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)