Parameters are now correctly passed on to sub-routes

This commit is contained in:
Simon Sessingø
2021-03-29 17:05:45 +02:00
parent b05bbccc28
commit d6d83ac5bd
3 changed files with 33 additions and 0 deletions
+10
View File
@@ -655,6 +655,16 @@ SimpleRouter::group(['prefix' => '/admin'], function () {
});
```
You can also use parameters in your groups:
```php
SimpleRouter::group(['prefix' => '/lang/{language}'], function ($language) {
SimpleRouter::get('/users', function () {
// Matches The "/admin/users" URL
});
});
```
## Partial groups
Partial router groups has the same benefits as a normal group, but supports parameters and are only rendered once the url has matched.