Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/228.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 发送404到科哈纳3的定制路线_Php_Exception Handling_Http Status Code 404_Kohana_Kohana 3 - Fatal编程技术网

Php 发送404到科哈纳3的定制路线

Php 发送404到科哈纳3的定制路线,php,exception-handling,http-status-code-404,kohana,kohana-3,Php,Exception Handling,Http Status Code 404,Kohana,Kohana 3,我已经了解了(Kohana的主要负责人)如何设置他的bootstrap.php文件来处理异常 我想,“太酷了”,所以我加入了一些类似的东西 但是,我希望将请求发送到不同的路由(或者至少将其指向控制器/操作对),而不是提供视图 所以这部分是关于GitHub的 // Create a 404 response $request->status = 404; $request->response = View::factory('template') ->set('title',

我已经了解了(Kohana的主要负责人)如何设置他的
bootstrap.php
文件来处理异常

我想,“太酷了”,所以我加入了一些类似的东西

但是,我希望将请求发送到不同的路由(或者至少将其指向控制器/操作对),而不是提供视图

所以这部分是关于GitHub的

 // Create a 404 response
$request->status = 404;
$request->response = View::factory('template')
->set('title', '404')
->set('content', View::factory('errors/404'));
可能是(当然是伪代码)


我该怎么做?感谢使用带有uri的Request::factory:

$request->response = Request::factory('error/404')->execute();
或使用以下路线:

$request->response = Request::factory(Route::get('error_404')->uri())->execute();

将Request::factory与uri一起使用:

$request->response = Request::factory('error/404')->execute();
或使用以下路线:

$request->response = Request::factory(Route::get('error_404')->uri())->execute();

最后一行,
Route::get()
需要
->uri()
不是吗?最后一行,
Route::get()
需要
->uri()
不是吗?