35 if ($request->
getMethod() ===
'OPTIONS') {
41 case 'application/json':
46 case 'application/xml':
59 $body =
new Body(
fopen(
'php://temp',
'r+'));
84 return '{"message":"Not found"}';
94 return '<root><message>Not found</message></root>';
106 $homeUrl = (string)($request->
getUri()->withPath(
'')->withQuery(
'')->withFragment(
''));
110 <title>Page Not Found</title>
115 font:12px/1.5 Helvetica,Arial,Verdana,sans-serif;
124 display:
inline-block;
130 <h1>Page Not Found</h1>
132 The page you
are looking
for could not be found. Check
the address bar
133 to ensure
your URL
is spelled correctly. If
all else fails, you can
134 visit our home page at
the link below.
136 <
a href=
'$homeUrl'>Visit
the Home Page</
a>
getMethod()
Retrieves the HTTP method of the request.
Representation of an incoming, server-side HTTP request.
foreach($paths as $path) $request
withStatus($code, $reasonPhrase='')
Return an instance with the specified status code and, optionally, reason phrase. ...
renderJsonNotFoundOutput()
Return a response for application/json content not found.
determineContentType(ServerRequestInterface $request)
Determine which content type we know about is wanted using Accept header.
all(array $promises)
This file contains a set of functions that are useful for dealing with the Promise object...
getUri()
Retrieves the URI instance.
__invoke(ServerRequestInterface $request, ResponseInterface $response)
Invoke not found handler.
Representation of an outgoing, server-side response.
renderPlainNotFoundOutput()
Render plain not found message.
Default Slim application not found handler.
if($path[strlen($path) - 1]==='/') if(is_dir($path)) if(!file_exists($path)) if(preg_match('#\.php$#D', mb_strtolower($path, 'UTF-8'))) $contentType
Slim Framework (https://slimframework.com)
renderXmlNotFoundOutput()
Return a response for xml content not found.
Abstract Slim application handler.
renderHtmlNotFoundOutput(ServerRequestInterface $request)
Return a response for text/html content not found.