문제

나는 방법을 보았다 그림자 (현재 Kohana의 주요 사람)는 그의 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

어떻게 할 수 있습니까? 감사

도움이 되었습니까?

해결책

요청 사용 :: URI와의 공장 :

$request->response = Request::factory('error/404')->execute();

또는 경로와 함께 :

$request->response = Request::factory(Route::get('error_404')->uri())->execute();
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top