PluginProbe
WPIDE – File Manager & Code Editor / trunk
WPIDE – File Manager & Code Editor vtrunk
3.5.8 3.5.7 2.0.14 2.0.15 2.0.16 2.0.2 2.0.4 2.0.5 2.0.6 2.0.7 2.0.8 2.0.9 2.1 2.2 2.3 2.3.1 2.3.2 2.4.0 2.5 2.6 3.0 3.1 3.2 3.3 3.4 All 54 releases
wpide / App / Controllers / ErrorController.php

ErrorController.php in WPIDE – File Manager & Code Editor trunk, at App/Controllers/ErrorController.php

27 lines 649 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace WPIDE\App\Controllers;
4
5 use WPIDE\App\Kernel\Request;
6 use WPIDE\App\Kernel\Response;
7
8 class ErrorController
9 {
10 protected $request_type;
11
12 public function __construct(Request $request)
13 {
14 $this->request_type = $request->getContentType();
15 }
16
17 public function notFound(Response $response)
18 {
19 return $this->request_type == 'json' ? $response->json('Not Found', 404) : $response->html('Not Found', 404);
20 }
21
22 public function methodNotAllowed(Response $response)
23 {
24 return $this->request_type == 'json' ? $response->json('Not Allowed', 401) : $response->html('Not Found', 401);
25 }
26 }
27