Skip to content

Commit 84d44a9

Browse files
committed
Document Route::input.
1 parent 847f098 commit 84d44a9

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

routing.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ Often, you will need to generate URLs to your routes, you may do so using the `U
8484
})
8585
->where('id', '[0-9]+');
8686

87+
**Passing An Array Of Wheres**
88+
8789
Of course, you may pass an array of constraints when necessary:
8890

8991
Route::get('user/{id}/{name}', function($id, $name)
@@ -92,6 +94,8 @@ Of course, you may pass an array of constraints when necessary:
9294
})
9395
->where(array('id' => '[0-9]+', 'name' => '[a-z]+'))
9496

97+
**Defining Global Patterns**
98+
9599
If you would like a route parameter to always be constrained by a given regular expression, you may use the `pattern` method:
96100

97101
Route::pattern('id', '[0-9]+');
@@ -101,6 +105,18 @@ If you would like a route parameter to always be constrained by a given regular
101105
// Only called if {id} is numeric.
102106
});
103107

108+
**Accessing A Route Parameter Value**
109+
110+
If you need to access a route parameter value outside of a route, you may use the `Route::input` method:
111+
112+
Route::filter('foo', function()
113+
{
114+
if (Route::input('id') == 1)
115+
{
116+
//
117+
}
118+
});
119+
104120
<a name="route-filters"></a>
105121
## Route Filters
106122

0 commit comments

Comments
 (0)