Personally I don't like the "guessing" of whether or not the first part
is a controller or module, and instead avoid the situation by forcing
URLs to always contain the module name, by overriding the default route:
$router = Zend_Controller_Front::getInstance();
$router->addRoute('default', new
Zend_Controller_Router_Route(':module/:controller/:action/*',
array('module' => 'default', 'controller' => 'index', 'action' =>
'index')));
AmirBehzad Eslami wrote:
Hi everyone,
I've faced with a Module-Controller naming conflict. Suppose:
1
==========================
I have two modules: "default" and "Foo".
I have a "Foo" controller in "default" module.
I have an "Index" controller in "Foo" module.
URL: Foo/ => This calls Foo_IndexController::indexAction()
URL: foo/ => This calls [Default's] FooController::indexAction()
2
==========================
I have two modules: "default" and "foo" (Note the lowercased foo)
I have a "Foo" controller in "default" module.
I have an "Index" controller in "foo" module.
URL: Foo/ => This calls [Default's] FooController::indexAction()
URL: foo/ => This calls Foo_IndexController::indexAction()
==========================
Is there any naming principle to prevent these confusions.
Not only this could cause the developer to confuse,
but there is a high risk for users to mis-spell a URL and
visit an incorrect page.
Thanks in advance,
Behzad
--
Jack