From 3e175d234dd7610e84e50919f8a6512b66508ee8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Sessing=C3=B8?= Date: Mon, 19 Oct 2015 00:41:09 +0200 Subject: [PATCH] Update README.md --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 3867cb4..e21a301 100644 --- a/README.md +++ b/README.md @@ -67,6 +67,12 @@ SimpleRouter::group(['prefix' => 'v1', 'middleware' => '\MyWebsite\Middleware\So SimpleRouter::get('/answers/{id}', 'ControllerAnswers@show') ->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 SimpleRouter::ressource('/rest', 'ControllerRessource');