Commit ac810f85 authored by Jason Lewis's avatar Jason Lewis

Allow filter patterns to supply a name and callback as an easier alternative.

Signed-off-by: 's avatarJason Lewis <jason.lewis1991@gmail.com>
parent 0ebeb14b
...@@ -213,6 +213,15 @@ class Route { ...@@ -213,6 +213,15 @@ class Route {
{ {
if (Str::is($pattern, $this->uri)) if (Str::is($pattern, $this->uri))
{ {
// If the filter provided is an array then we need to register
// the filter before we can assign it to the route.
if (is_array($filter))
{
list($filter, $callback) = array_values($filter);
Filter::register($filter, $callback);
}
$filters[] = $filter; $filters[] = $filter;
} }
} }
......
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