Backslider
(Developer)
1
I have a module and am trying to use external action files within it.
In my DefaultController I have:
public function actions()
{
return array('people'=>array('class' => 'application.modules.mymodule.controllers.actionPeople'));
}
The action class exists as above, however the system returns a 404 when trying to access: index.php?r=mymodule/people
What gives?
seenivasan
(Chellamnivas)
2
Dear Friend
Default controller for a Module is DefaultContoller.
Default action of CController is index.
These are the default things unless we specifically overide it.
When we put something like this
index.php?r=mymodule
It is meant like
index.php?r=mymodule/default/index
The following is not going to work
index.php?r=mymodule/index
index.php?r=mymodule/people
The following is going to work
index.php?r=mymodule/default/index
index.php?r=mymodule/default/people
If I put actions in the module in the regular way, eg.
public function actions()
{
return array('people');
}
then create an action in the regular way:
public function actionPeople()
{
// do stuff
}
Then yes, I can access the action thus: index.php?r=mymodule/people
I would expect the same for an external action.