Skip to content
Browse files

Updated example, small typo.

  • Loading branch information...
1 parent 58cf2ea commit 4c922399405c747fe0bad0b034aec2d1c62353aa @dannyvankooten committed Nov 29, 2011
Showing with 8 additions and 4 deletions.
  1. +6 −2 README.md
  2. +2 −2 example.php
View
8 README.md
@@ -24,7 +24,7 @@ A simple Rails inspired PHP router class.
$r->match('/users','users#create',array('via' => 'post'));
// maps GET /users/5/edit to controller 'users', method 'edit' with parameters 'id' => 5 and saves route as a named route.
- $r->match('/user/:id/edit','users#edit',array('via' => 'get', 'as' => 'user_edit_page'));
+ $r->match('/users/:id/edit','users#edit',array('via' => 'get', 'as' => 'user_edit_page'));
// echoes /users/5/edit
echo $r->reverse('user_edit_page',array('id' => '5'));
@@ -49,5 +49,9 @@ A simple Rails inspired PHP router class.
} else {
?><h1>No route found.</h1><?php
}
+
+ ?>
-Have a look at example.php or read trough the class' documentation for a better understanding on how to use this class.
+
+## More information
+Have a look at the example file or read trough the class' documentation for a better understanding on how to use this class.
View
4 example.php
@@ -9,7 +9,7 @@
$r->match('/','users#index');
// maps /user/5 to controller 'users', method 'show' with parameter 'id' => 5
-$r->match('/user/:id','users#show');
+$r->match('/users/:id','users#show');
// maps POST request to /users/ to controller 'users' and method 'create'
$r->match('/users','users#create',array('via' => 'post'));
@@ -18,7 +18,7 @@
$r->match('/photos/show');
// maps GET /users/5/edit to controller 'users', method 'edit' with parameters 'id' => 5 and saves route as a named route.
-$r->match('/user/:id/edit','users#edit',array('via' => 'get', 'as' => 'user_edit_page'));
+$r->match('/users/:id/edit','users#edit',array('via' => 'get', 'as' => 'user_edit_page'));
// echoes /users/5/edit
echo $r->reverse('user_edit_page',array('id' => '5'));

0 comments on commit 4c92239

Please sign in to comment.
Something went wrong with that request. Please try again.