我正在http://kohanaframework.org/3.3/guide/kohana/tutorials/error-pages关注 Kohana 3.3
的教程以下代码位于 classes / http / exception / 404.php
<?php
class HTTP_Exception_404 extends Kohana_HTTP_Exception_404 {
public function get_response(){
$view = View::factory('errors/404');
$view->message = $this->getMessage();
$response = Response::factory()
->status(404)
->body($view->render());
return $response;
}
}
尝试提供错误的网址时
的本地主机/ MyApp的/ XYZ 的
出现以下错误
ErrorException [ Parse Error ]:
APPPATH\classes\http\exception\404.php [ 3 ]
1 <?php
2 class HTTP_Exception_404 extends Kohana_HTTP_Exception_404 {
3
4
5
6
7
8
{PHP internal call} » Kohana_Core::shutdown_handler()
在 bootstrap.php 中,init的代码是
Kohana::init(array(
'base_url' => '/myapp/',
'errors' => TRUE,
'index_file' => FALSE,
));
我该如何解决这个问题?谢谢。
答案 0 :(得分:1)
要检查的几件事情:
errors/404
APPPATH/views/errors/404.php
视图?
APPPATH\Classes\HTTP\Exception\404.php
?答案 1 :(得分:0)
使用大写字母重命名目录 的类/ HTTP /异常/ 404.php 强>