YII – Get name of current controller’s action

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

<?php

    echo Yii::app()->controller->action->id
?>

 

 

 

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *

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