From 2a97e013905187529181c2dae6938364826a9846 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Sessing=C3=B8?= Date: Sun, 11 Oct 2015 10:42:13 +0200 Subject: [PATCH 1/3] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 722381a..39c0810 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# [WIP] Simple PHP router +# Simple PHP router Simple, fast PHP router that is easy to get integrated and in almost any project. Heavily inspired by the Laravel router. **Please note: this project has just been added and is still a work in progress. Please use with caution until a stable release version is available :)** From 624df047e72062806a0e4759c278b6a3f11b78e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Sessing=C3=B8?= Date: Sun, 11 Oct 2015 10:44:46 +0200 Subject: [PATCH 2/3] Update README.md --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index 39c0810..7252bf2 100644 --- a/README.md +++ b/README.md @@ -57,6 +57,17 @@ SimpleRouter::group(['prefix' => 'v1', 'middleware' => '\MyWebsite\Middleware\So SimpleRouter::group(['prefix' => 'services'], function() { SimpleRouter::get('/answers/{id}', 'ControllerAnswers@show'); + + // Resetful ressource + Router::ressource('/rest', 'ControllerRessource'); + + // Load the entire controller (where url matches method names - getIndex(), postIndex() etc) + Router::controller('/controller', 'ControllerDefault'); + + // Example of providing callback instead of Controller + SimpleRouter::get('/something', function() { + die('Callback example'); + }); }); }); From 8d4e765556baf787bc26fa0685e95f62428d0c1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Sessing=C3=B8?= Date: Sun, 11 Oct 2015 10:45:46 +0200 Subject: [PATCH 3/3] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 7252bf2..e822709 100644 --- a/README.md +++ b/README.md @@ -59,10 +59,10 @@ SimpleRouter::group(['prefix' => 'v1', 'middleware' => '\MyWebsite\Middleware\So SimpleRouter::get('/answers/{id}', 'ControllerAnswers@show'); // Resetful ressource - Router::ressource('/rest', 'ControllerRessource'); + SimpleRouter::ressource('/rest', 'ControllerRessource'); // 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 SimpleRouter::get('/something', function() { @@ -158,7 +158,7 @@ function url($controller, $parameters = null, $getParams = null) { 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: