내 웹 사이트의 양식 정보에 따라 페이지 (예 : error.php)로 리디렉션하고 싶습니다. 이 같은 오류를 기록 관리 :슬림 프레임 워크 오류로 다른 페이지로 리디렉션
if ($date > $curdate) {
return $response
->withStatus(406)
->withHeader('Content-Type', 'text/html')
->write('You can\'t select dates in the future!');
}
당신이 네트워크 탭에서 요청/대신 로깅 특히 해당 오류가있는 페이지로 전송하는 그래서 그것을 할 수 있습니까?
는 지금은이를 얻을 : 의도 한대로
Request URL:http://raspberrypi/chartAPI/api/{id}/{date1}/{date2}
Request Method:POST
Status Code:406 Not Acceptable
Remote Address:192.168.0.80:80
Referrer Policy:no-referrer-when-downgrade
거의 작동된다. 내가하고자하는 일은 "http://raspberrypi/chartAPI/error/406"(예를 들어)로 나를 보내고 406.php (또는 error406.php 또는 error.php 또는 무엇이든 그것을 호출하는)라는 파일에 내용을 표시하는 것입니다.
나는이 뭔가 할 관리 :return $response->withRedirect("error.php");
을하지만이 얻을 :
Request URL:http://raspberrypi/chartAPI/api/{id}/{date1}/error.php
Request Method:GET
Status Code:405 Method Not Allowed
을 그리고 슬림이 오류 발생 : {DATE2를
Method not allowed. Must be one of: POST
은 왜 제거됩니다 }? 그리고 왜 POST 방법을 요구하고 있습니까?
이 질문은 this one의 연속이지만,이 웹 사이트에서 어떻게 이러한 "오래된"질문을 처리했는지에 따라 광산이 밀렸으며 편집 한 횟수에 관계없이 더 이상주의를 끌지 않습니다.
가능한 [Slim Framework에서 오류로 리디렉션] (http://stackoverflow.com/questions/43611649/redirecting-with-error-on-slim-framework) – geggleto
@geggleto 그 말은 내가 말한 것입니다. 질문. – Newwt