Custom 404 and 405 error pages
This commit is contained in:
parent
280618bb6b
commit
b6b4dad2ec
3 changed files with 24 additions and 1 deletions
|
@ -260,6 +260,28 @@ class FrontController extends BaseController
|
|||
return $response->withStatus(StatusCode::HTTP_INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Request $request
|
||||
* @param Response $response
|
||||
* @return Response
|
||||
*/
|
||||
public function notFound(Request $request, Response $response)
|
||||
{
|
||||
return $this->displayError($request, $response, $this->localeManager->t('Page not found'))
|
||||
->withStatus(StatusCode::HTTP_NOT_FOUND);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Request $request
|
||||
* @param Response $response
|
||||
* @return Response
|
||||
*/
|
||||
public function notAllowed(Request $request, Response $response)
|
||||
{
|
||||
return $this->displayError($request, $response, $this->localeManager->t('Method not allowed'))
|
||||
->withStatus(StatusCode::HTTP_METHOD_NOT_ALLOWED);
|
||||
}
|
||||
|
||||
/**
|
||||
* Display an error page.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue