class DefaultController extends CController
{
public function actionIndex()
{
echo "moduleA/index";
}
public function actionTest()
{
echo "moduleA/test";
}
}
class DefaultController extends CController
{
public function actionIndex()
{
Yii::app()->runController('modulea/default/index');
}
public function actionTest()
{
echo "moduleB/test";
}
}
if I run URL: /moduleb/default/index i get this:
Fatal error: Maximum function nesting level of ‘100’ reached, aborting! in /Users/ifrinx/www/YiiNode/framework/YiiBase.php on line 8
‘createContoller’ and redirection is not that i need, because i need to run other controller by route in current controller, my goal is stay at the current URL and run other module inspite of it’s parameters list
Your problem appears because you have 2(!) controllers with the same name “DefaultController” in your application.
When you request route “moduleb/default/index” the file “moduleb/controllers/DefaultController” is loaded by Yii autoload for the class “DefaultController”. Then you request route “modulea/default/index”, which requires controller with the same name “DefaultController”, which is already filled up with “moduleb/controllers/DefaultController”, so you get an infinite recursion.
That is one of the reasons namespaces have been invented.
To solve your problem you should name the default controllers for your modules differently.