| @@ 102-111 (lines=10) @@ | ||
| 99 | $router = new \Anax\Route\CRouterBasic(); |
|
| 100 | $router->setDI($this); |
|
| 101 | ||
| 102 | $router->addInternal("403", function () { |
|
| 103 | $this->dispatcher->forward([ |
|
| 104 | "controller" => "error", |
|
| 105 | "action" => "statusCode", |
|
| 106 | "params" => [ |
|
| 107 | "code" => 403, |
|
| 108 | "message" => "HTTP Status Code 403: This is a forbidden route.", |
|
| 109 | ], |
|
| 110 | ]); |
|
| 111 | })->setName("403"); |
|
| 112 | ||
| 113 | $router->addInternal("404", function () { |
|
| 114 | $this->dispatcher->forward([ |
|
| @@ 128-137 (lines=10) @@ | ||
| 125 | ]); |
|
| 126 | })->setName("404"); |
|
| 127 | ||
| 128 | $router->addInternal("500", function () { |
|
| 129 | $this->dispatcher->forward([ |
|
| 130 | "controller" => "error", |
|
| 131 | "action" => "statusCode", |
|
| 132 | "params" => [ |
|
| 133 | "code" => 500, |
|
| 134 | "message" => "HTTP Status Code 500: There was an internal server or processing error.", |
|
| 135 | ], |
|
| 136 | ]); |
|
| 137 | })->setName("500"); |
|
| 138 | ||
| 139 | return $router; |
|
| 140 | }); |
|