我看过
shadowhand
(科哈纳背后的主要人物)建立了他的
bootstrap.php
处理异常的文件
GitHub
.
我想,“很酷”,所以我加入了类似的东西。
但是,我不提供视图,而是将请求发送到其他路由(或者至少将其指向控制器/操作对)。
所以这部分在Github上
// Create a 404 response
$request->status = 404;
$request->response = View::factory('template')
->set('title', '404')
->set('content', View::factory('errors/404'));
会是类似的(当然是伪代码)
// Create a 404 response
$request->status = 404;
$request->response = Route::get('404_error'); // which will map to a route outlined above in bootstrap.php
我该怎么做?谢谢