mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-07-12 00:42:11 +00:00
Merge branch 'master' of https://github.com/skipperbent/simple-php-router into development
Conflicts: README.md
This commit is contained in:
@@ -71,8 +71,14 @@ 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]+');
|
||||||
|
|
||||||
// Resetful ressource
|
/**
|
||||||
SimpleRouter::ressource('/rest', 'ControllerRessource');
|
* 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 resource
|
||||||
|
SimpleRouter::resource('/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)
|
||||||
SimpleRouter::controller('/controller', 'ControllerDefault');
|
SimpleRouter::controller('/controller', 'ControllerDefault');
|
||||||
@@ -188,3 +194,25 @@ http://laravel.com/docs/5.1/routing
|
|||||||
|
|
||||||
## Easily extendable
|
## Easily extendable
|
||||||
The router can be easily extended to customize your needs.
|
The router can be easily extended to customize your needs.
|
||||||
|
|
||||||
|
## The MIT License (MIT)
|
||||||
|
|
||||||
|
Copyright (c) 2015 Simon Sessingø / simple-php-router
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
Reference in New Issue
Block a user