I have the following structure of my system:
application/
configs/
application.ini
router.php
layouts/
modules/
default/
controllers/
forms/
models/
views/
Bootstrap.php
test/
controllers/
forms/
models/
views/
Bootstrap.php
Bootstrap.php
routes.php file:
$useDefaultRoutes = false;
$routes['index'] = new Zend_Controller_Router_Route(
'',
array('controller' => 'index',
'action' => 'index',
'module' => 'default'));
Main Bootstrap.php file
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
public static function setRoutes(){
$frontController = Zend_Controller_Front::getInstance();
$router = $frontController->getRouter();
$routes = array();
if(file_exists('../application/configs/routes.php'))
{
require_once "configs/routes.php";
foreach($routes as $routeName => $routeValue){
$router->addRoute($routeName, $routeValue);
}
if($useDefaultRoutes == false)
{
$router->removeDefaultRoutes();
}
}
}
protected function _initFrontModules() {
$this->bootstrap('frontController');
$front = $this->getResource('frontController');
$this->setRoutes();
}
}
Problem
When I type in browser http://address, then default module launches IndexController and everything seems to be ok. But if I type http://address/test, then I get error - page not found. If I remove routes.php file, then it works. So what is the problem with my routing ?
Your help would be appreciated.