YII – Get Controller name

In Yii framework if we want to get name of current controller name. It can be done by following command.

<?php 

Yii::app()->controller->id;

?>

 

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.