【发布时间】:2011-08-25 14:48:49
【问题描述】:
我正在尝试向我的应用程序添加一个路由,以便我可以将它与 ajax 调用一起使用。
这是我的 application.ini 中的内容
;Routes
resources.router.routes.products.route = "/backend/api/:command"
resources.router.routes.products.defaults.module = "backend"
resources.router.routes.products.defaults.controller = "api"
resources.router.routes.products.defaults.action = "index"
当对 /backend/api/SomeCommand 进行 ajax 调用时,会产生以下错误:
消息:指定的控制器无效(后端)
array (
'controller' => 'backend',
'action' => 'maestro',
'module' => 'default',
)
如您所见,module 已设置为“default”,而不是“backend”,并且控制器是“backend”而不是“api”,这可能是什么原因造成的?
【问题讨论】:
标签: zend-framework bootstrapping zend-route