1
我看過shadowhand(Kohana目前的主要人物)如何設置他的bootstrap.php
文件來處理GitHub的異常。發送404s到Kohana的自定義路由3
我想,「這很酷」,所以我加入了類似的東西。
但是,我不想提供視圖,而是將請求發送到不同的路由(或至少將其指向控制器/操作對)。
因此,這部分在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
我怎樣才能做到這一點?由於
最後一行,則'路線::得到()''需要 - > URI ()'不是嗎? – alex 2010-03-02 05:36:33
是的,更正。謝謝alex。 – rick 2010-03-03 01:43:35