поиск+доставка
This commit is contained in:
@@ -18,6 +18,11 @@ final class Router
|
||||
$this->routes[] = ['method' => 'GET', 'pattern' => $pattern, 'handler' => $handler];
|
||||
}
|
||||
|
||||
public function post(string $pattern, callable $handler): void
|
||||
{
|
||||
$this->routes[] = ['method' => 'POST', 'pattern' => $pattern, 'handler' => $handler];
|
||||
}
|
||||
|
||||
public function dispatch(string $method, string $uri): void
|
||||
{
|
||||
$path = parse_url($uri, PHP_URL_PATH) ?: '/';
|
||||
|
||||
Reference in New Issue
Block a user