From 47ce76fbb7e791b090e01982b0a2a4d4f871b43a Mon Sep 17 00:00:00 2001 From: steampixel Date: Mon, 12 Mar 2018 17:12:05 +0100 Subject: [PATCH] Added navigation and testing instructions --- README.md | 11 +++++++++-- Route.php | 2 +- index.php | 13 +++++++++++++ 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 0572594..9510eb2 100644 --- a/README.md +++ b/README.md @@ -16,5 +16,12 @@ Route::add('/user/(.*)/edit',function($id){ }); ``` -## Something dows not work? -Dont forget to set the basepath in your index.php and .htaccess file. +## Testing +* Clone or download this repo +* Cd into the repo folder and run: +* ```php -S 0.0.0.0:8080``` +* Than open your Webbrowser and navigate to http://localhost:8080 + +## Something does not work? +* Dont forget to set the basepath in your index.php and .htaccess file. +* Enable mod_rewrite in your apache settings diff --git a/Route.php b/Route.php index 3d44584..08ec516 100644 --- a/Route.php +++ b/Route.php @@ -53,7 +53,7 @@ class Route{ // Add 'find string end' automatically $route['expression'] = $route['expression'].'$'; - //echo $route['expression'].'
'; + // echo $route['expression'].'
'; // Check match if(preg_match('#'.$route['expression'].'#',self::$path,$matches)){ diff --git a/index.php b/index.php index 745fd62..f10afc2 100644 --- a/index.php +++ b/index.php @@ -67,3 +67,16 @@ Route::add404(function($url){ // Check if any of the defined routes will match and execute them Route::run(); + +?> + +
+Navigation: +