Commit ecdd559a by Taylor Otwell

Edited readme.md via GitHub

parent a9f7aace
...@@ -165,19 +165,11 @@ You can easily define a route to handle requests to more than one URI. Just use ...@@ -165,19 +165,11 @@ You can easily define a route to handle requests to more than one URI. Just use
<a name="routes-parameters"></a> <a name="routes-parameters"></a>
### Route URI Parameters ### 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) {} '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. 'GET /user/(:any)/edit' => function($username) {}
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) {}
Sometimes you may wish to make a parameter optional. You can do so by placing a **?** in parameter: Sometimes you may wish to make a parameter optional. You can do so by placing a **?** in parameter:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment