Better solution for groups without a prefix
This commit is contained in:
parent
74bd080709
commit
8cf26b4d0d
@ -73,7 +73,7 @@ abstract class Route
|
||||
);
|
||||
}
|
||||
|
||||
static function group(string $prefix = '', ?callable $callback = null)
|
||||
static function group(string $prefix, callable $callback)
|
||||
{
|
||||
if (!str_starts_with(
|
||||
$_SERVER['REQUEST_URI'],
|
||||
|
@ -51,7 +51,7 @@ App::group('/test', function() {
|
||||
fn() => print('Testing 123'));
|
||||
|
||||
// you may also define a group without a prefix
|
||||
App::group(callback: function() {
|
||||
App::group('', function() {
|
||||
App::get('/test',
|
||||
fn() => print('Testing 456'));
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user