Files
kiri-router/src/Base/NotFoundController.php
T

27 lines
503 B
PHP
Raw Normal View History

2023-04-15 23:29:27 +08:00
<?php
2023-04-16 01:24:30 +08:00
declare(strict_types=1);
2023-04-15 23:29:27 +08:00
2023-04-15 23:31:16 +08:00
namespace Kiri\Router\Base;
2023-04-15 23:29:27 +08:00
2023-04-16 01:24:30 +08:00
use Psr\Http\Message\ResponseInterface;
2023-04-15 23:29:27 +08:00
class NotFoundController extends Controller
{
2023-09-15 09:13:59 +08:00
/**
* @return ResponseInterface
*/
public function fail(): ResponseInterface
{
2025-12-30 21:43:56 +08:00
var_dump($this->request->getMethod());
2023-09-15 09:13:59 +08:00
if ($this->request->getMethod() == 'OPTIONS') {
2025-12-30 21:39:18 +08:00
return $this->response->html('');
2023-09-15 15:54:52 +08:00
} else {
2023-11-17 09:43:39 +08:00
return $this->response->withStatus(404, "not found page.");
2023-09-15 09:13:59 +08:00
}
}
2023-04-15 23:29:27 +08:00
}