mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-07-11 20:52:12 +00:00
Update README.md
This commit is contained in:
@@ -67,6 +67,12 @@ SimpleRouter::group(['prefix' => 'v1', 'middleware' => '\MyWebsite\Middleware\So
|
|||||||
SimpleRouter::get('/answers/{id}', 'ControllerAnswers@show')
|
SimpleRouter::get('/answers/{id}', 'ControllerAnswers@show')
|
||||||
->where(['id' => '[0-9]+');
|
->where(['id' => '[0-9]+');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This example will route url when matching the regular expression to the method.
|
||||||
|
* For example route: /ajax/music/world -> ControllerAjax@process (parameter: music/world)
|
||||||
|
*/
|
||||||
|
SimpleRouter::all('/ajax', 'ControllerAjax@process')->match('ajax\\/([A-Za-z0-9\\/]+)');
|
||||||
|
|
||||||
// Resetful ressource
|
// Resetful ressource
|
||||||
SimpleRouter::ressource('/rest', 'ControllerRessource');
|
SimpleRouter::ressource('/rest', 'ControllerRessource');
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user