Permet de supprimer une news

This commit is contained in:
2022-12-14 11:33:09 +01:00
parent 2ab457aa8f
commit ca78aca8cb
5 changed files with 28 additions and 1 deletions

View File

@@ -46,6 +46,11 @@ class Router
return $this->addRoute(['GET', 'POST'], $path, $callable);
}
public function delete(string $path, callable $callable): self
{
return $this->addRoute(['DELETE'], $path, $callable);
}
private function addRoute(array $methods, string $path, $callable): self
{
$route = new Route($path, $callable);