In Yii, when access to <app-host>/index.php?r=<mycontroller>/<myaction>
, the framework will start to run code in protected/controller/<MyController>Controller.php
I want to that code to be located in another folder, says protected/anotherFolder
, while other controllers remain as-is. How to do that?
Regards
Thanks to mdomba
on yii forum at this post, I found the answer using CWebApplication::controllerMap
- in the loading state of the application we call
Yii::app()->controllerMap['yourControllerName']='path.alias.to.your.controller.file.without.dotPHP';
You can use controllerMap - http://www.yiiframew...ollerMap-detail