From 94e833da68fae859619e44aa560009d46e0553e0 Mon Sep 17 00:00:00 2001 From: Jepp9350 <2jepp9350@gmail.com> Date: Tue, 17 Dec 2024 12:01:01 +0100 Subject: [PATCH] Added PATCH route method. --- traits/route_t.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/traits/route_t.php b/traits/route_t.php index 9f02660d..08334731 100644 --- a/traits/route_t.php +++ b/traits/route_t.php @@ -69,6 +69,15 @@ trait route_t $this->registerRoute($route, 'OPTIONS', $callback); } + /** + * PATCH route + * @param string $route Example: /home, /home/{id} + */ + public function patch(string $route, callable $callback): void + { + $this->registerRoute($route, 'PATCH', $callback); + } + /** * Match route * @param string $route Example: /home, /home/{id}