From ecdd559ace17bc4637f8ffdf14fbdb4583ae2d37 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Thu, 14 Jul 2011 11:11:57 -0700 Subject: [PATCH] Edited readme.md via GitHub --- readme.md | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/readme.md b/readme.md index 4876ec22..889af30c 100644 --- a/readme.md +++ b/readme.md @@ -165,19 +165,11 @@ ### The Basics ### Route URI Parameters -Laravel makes passing URI parameters to your route functions a breeze. Check out this route: +Laravel makes passing URI parameters to your route functions a breeze using the **(:num)** and **(:any)** place-holders: 'PUT /user/(:num)' => function($id) {} -Notice the **(:num)** parameter in the URI? This tells Laravel to allow any numeric value in the second segment of the URI, as well as to pass the segment into the method. - -We can also use the **(:any)** parameter to match the segment to any value: - - 'DELETE /product/(:any)' => function($name) {} - -Of course, you are not limited to one parameter: - - 'GET /post/(:num)/(:num)' => function($month, $day) {} + 'GET /user/(:any)/edit' => function($username) {} Sometimes you may wish to make a parameter optional. You can do so by placing a **?** in parameter: