Is there a way to get the current action name from within the Controller.php init function ?
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In general, you can call
$this->action->idwithin descendant of theCControllerclass.Or you can use
Yii::app()->controller->action->idthrough whole application.But the method
init()was called before the controller started to execute (see http://www.yiiframework.com/doc/api/1.1/CController#init-detail)As you can see here: http://www.yiiframework.com/doc/api/1.1/CWebApplication#runController-detail
actionIDwill be passed to methodrun()only afterinit():