I am writing a Zend application.
I am using zend command line tool. I created a couple of modules Default
and User
and marked Default
as the default controller in the application config file. I created respective Index controllers/actions to these two modules too.
When I browse the site root, everything is fine. But when I browse $site_root$/user
, instead of getting the index controller stuff i get errors.
Notice: Undefined index: user in E:\xampp\php\PEAR\Zend\Controller\Dispatcher\Standard.php on line 384
Message: Invalid controller specified (index)
Stack trace:
#0 E:\xampp\php\PEAR\Zend\Controller\Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#1 E:\xampp\php\PEAR\Zend\Application\Bootstrap\Bootstrap.php(97): Zend_Controller_Front->dispatch()
#2 E:\xampp\php\PEAR\Zend\Application.php(366): Zend_Application_Bootstrap_Bootstrap->run()
#3 E:\xampp\htdocs\$project$\public\index.php(26): Zend_Application->run()
#4 {main}
Request Parameters:
array (
'module' => 'user',
'controller' => 'index',
'action' => 'index',
)
However when I browse $site_root$/User
, everything is OK again. Apparently the URL has to be case sensitive to reflect the module name. I have thought of some way-around for this like re-writing Zend Request class. But what is the best practice to get lower case module name in URL working?
Edit 1: Folder structure: