我正在将cakephp 1.3迁移到2.0。我遵循cakephp迁移指南,但升级后我得到以下错误。
Notice: Undefined index: controller in C:\xampp\htdocs\pro\lib\Cake\Routing\Dispatcher.php
( ! ) Fatal error: Uncaught exception 'MissingControllerException' with message 'Controller class Controller could not be found.' in C:\xampp\htdocs\pro\lib\Cake\Routing\Dispatcher.php on line 83
( ! ) MissingControllerException: Controller class Controller could not be found. in C:\xampp\htdocs\pro\lib\Cake\Routing\Dispatcher.php on line 83
如果有人已经通过相同的情况,任何人都可以指导我做错了吗? 任何帮助都会被证实。
答案 0 :(得分:2)
错误消息来自the dispatch function:
public function dispatch(CakeRequest $request, CakeResponse $response, $additionalParams = array()) {
if ($this->asset($request->url, $response) || $this->cached($request->here)) {
return;
}
$request = $this->parseParams($request, $additionalParams);
Router::setRequestInfo($request);
$controller = $this->_getController($request, $response);
if (!($controller instanceof Controller)) {
throw new MissingControllerException(array( # line 83
'class' => Inflector::camelize($request->params['controller']) . 'Controller',
'plugin' => empty($request->params['plugin']) ? null : Inflector::camelize($request->params['plugin'])
));
}
return $this->_invoke($controller, $request, $response);
}
这意味着:没有路由符合请求。
一个常见的原因是miss loading the default routes负责catchall routes的in 1.3 are automatic。