我正在zend框架中运行两个模块。1是管理(后端),另一个是客户端(前端)。我已经为两个模块分配了两个虚拟主机。后端工作正常。而且,在前端,我得到了索引页面。但当我试图在第二页上移动时,它会给我错误,比如:
A 404 error occurred
Page not found.
The requested controller could not be mapped to an existing controller class.
Controller:
Client'Controller'Search(resolves to invalid controller class or alias: Client'Controller'Search)
No Exception available
这是module.config.php文件的主要部分。。。
'controllers' => array(
'invokables' => array(
'Client'Controller'Index' => 'Client'Controller'IndexController',
'Client'Controller'Search' => 'Client'Controller'SearchController',
),
),
在路由器中,这是第二页路由的代码。。
'search' => array(
'type' => 'segment',
'options' => array(
'route' => '/search[/][:action][/:id]',
'constraints' => array(
'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
'id' => '[0-9]+',
),
'defaults' => array(
'controller' => 'Client'Controller'Search',
'action' => 'index',
),
),
),
我不知道发生了什么事。我们将不胜感激。
'controllers' => array(
//
'classes' => array(
'Client'Controller'Index' => 'Client'Controller'IndexController',
'Client'Controller'Search' => 'Client'Controller'SearchController',
),
'invokables' => array(
'Client'Controller'Index' => 'Client'Controller'IndexController',
'Client'Controller'Search' => 'Client'Controller'SearchController',
),
),
'search' => array(
'type' => 'Segment', // <- I added S
'options' => array(
'route' => '/search[/][:action][/:id]',
'constraints' => array(
'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
'id' => '[0-9]+',
),
'defaults' => array(
'controller' => 'Client'Controller'Search',
'action' => 'index',
),
),
),
如果不起作用,请向我们展示module.php