Skip to content

Commit b4e911b

Browse files
committed
add getOrPost route method
1 parent 01aa174 commit b4e911b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/Router/Router.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@
44

55
namespace MicroPHP\Framework\Router;
66

7+
use League\Route\RouteGroup;
8+
79
class Router extends \League\Route\Router
810
{
11+
public function getOrPost(string $path, $handler): RouteGroup
12+
{
13+
return $this->group('', function(RouteGroup $group) use ($path, $handler) {
14+
$group->get($path, $handler);
15+
$group->post($path, $handler);
16+
});
17+
}
918
}

0 commit comments

Comments
 (0)