cakephp1.3中是否可以为不同的错误设置不同的布局?
这是我的AppError类
function _outputMessage($template) {
$this->controller->beforeFilter();
$this->controller->render($template);
$this->controller->afterFilter();
echo $this->controller->output;
}
function error404($params) {
extract($params, EXTR_OVERWRITE);
header("HTTP/1.0 404 Not Found");
$this->error(array('code' => '404',
'name' => 'Not found',
'message' => sprintf("page not found %s", $url, $message),
'base' => $base));
exit();
}
function item404($params) {
extract($params, EXTR_OVERWRITE);
header("HTTP/1.0 404 Not Found");
$this->error(array('code' => '404',
'name' => 'Not found',
'message' => sprintf("Item not found %s", $url, $message),
'base' => $base));
exit();
}
我想分别有布局“错误”和布局“itemerror”。我尝试在函数中设置布局,但它不起作用。
任何帮助表示赞赏,