mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-07-11 20:12:14 +00:00
Update README.md
This commit is contained in:
@@ -17,6 +17,16 @@ Add the latest version pf Simple PHP Router to your ```composer.json```
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Notes
|
||||||
|
|
||||||
|
### Features currently "in-the-works"
|
||||||
|
|
||||||
|
- Global Constraints
|
||||||
|
- Named Routes
|
||||||
|
- Sub-Domain Routing
|
||||||
|
- CSRF Protection
|
||||||
|
- Optinal/required parameters
|
||||||
|
|
||||||
## Initialising the router
|
## Initialising the router
|
||||||
|
|
||||||
In your ```index.php``` require your ```routes.php``` and call the ```routeRequest()``` method when all your custom routes has been loaded. This will trigger and do the actual routing of the requests.
|
In your ```index.php``` require your ```routes.php``` and call the ```routeRequest()``` method when all your custom routes has been loaded. This will trigger and do the actual routing of the requests.
|
||||||
@@ -56,7 +66,8 @@ SimpleRouter::group(['prefix' => 'v1', 'middleware' => '\MyWebsite\Middleware\So
|
|||||||
|
|
||||||
SimpleRouter::group(['prefix' => 'services'], function() {
|
SimpleRouter::group(['prefix' => 'services'], function() {
|
||||||
|
|
||||||
SimpleRouter::get('/answers/{id}', 'ControllerAnswers@show');
|
SimpleRouter::get('/answers/{id}', 'ControllerAnswers@show')
|
||||||
|
->where(['id' => '[0-9]+');
|
||||||
|
|
||||||
// Resetful ressource
|
// Resetful ressource
|
||||||
SimpleRouter::ressource('/rest', 'ControllerRessource');
|
SimpleRouter::ressource('/rest', 'ControllerRessource');
|
||||||
|
|||||||
Reference in New Issue
Block a user