mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-07-11 04:12:13 +00:00
Update README.md
This commit is contained in:
@@ -59,10 +59,10 @@ SimpleRouter::group(['prefix' => 'v1', 'middleware' => '\MyWebsite\Middleware\So
|
|||||||
SimpleRouter::get('/answers/{id}', 'ControllerAnswers@show');
|
SimpleRouter::get('/answers/{id}', 'ControllerAnswers@show');
|
||||||
|
|
||||||
// Resetful ressource
|
// Resetful ressource
|
||||||
Router::ressource('/rest', 'ControllerRessource');
|
SimpleRouter::ressource('/rest', 'ControllerRessource');
|
||||||
|
|
||||||
// Load the entire controller (where url matches method names - getIndex(), postIndex() etc)
|
// Load the entire controller (where url matches method names - getIndex(), postIndex() etc)
|
||||||
Router::controller('/controller', 'ControllerDefault');
|
SimpleRouter::controller('/controller', 'ControllerDefault');
|
||||||
|
|
||||||
// Example of providing callback instead of Controller
|
// Example of providing callback instead of Controller
|
||||||
SimpleRouter::get('/something', function() {
|
SimpleRouter::get('/something', function() {
|
||||||
@@ -158,7 +158,7 @@ function url($controller, $parameters = null, $getParams = null) {
|
|||||||
|
|
||||||
In ```routes.php``` we have added this route:
|
In ```routes.php``` we have added this route:
|
||||||
|
|
||||||
```Router::get('/item/{id}', 'myController@show');```
|
```SimpleRouter::get('/item/{id}', 'myController@show');```
|
||||||
|
|
||||||
In the template we then call:
|
In the template we then call:
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user