diff --git a/laravel/routing/caller.php b/laravel/routing/caller.php index 9bcb68dc..a76c302f 100644 --- a/laravel/routing/caller.php +++ b/laravel/routing/caller.php @@ -134,7 +134,7 @@ class Caller { // an underscore are not publicly available. if (is_null($controller) or ($method == 'before' or strncmp($method, '_', 1) === 0)) { - return $this->container->resolve('laravel.response')->error('404'); + return Response::error('404'); } $controller->container = $this->container; @@ -222,6 +222,16 @@ class Caller { { foreach ((array) $filters as $filter) { + // Parameters may be passed into routes by specifying the list of parameters after + // a colon. If parameters are present, we will merge them into the parameter array + // that was passed to the method and slice the parameters off of the filter string. + if (($colon = strpos($filter, ':')) !== false) + { + $parameters = array_merge($parameters, explode(',', substr($filter, $colon + 1))); + + $filter = substr($filter, 0, $colon); + } + if ( ! isset($this->filters[$filter])) continue; $response = call_user_func_array($this->filters[$filter], $parameters); diff --git a/laravel/routing/route.php b/laravel/routing/route.php index b724cce9..b9a1f58e 100644 --- a/laravel/routing/route.php +++ b/laravel/routing/route.php @@ -126,7 +126,9 @@ class Route { { if (is_array($this->callback) and isset($this->callback[$name])) { - return explode(', ', $this->callback[$name]); + $filters = $this->callback[$name]; + + return (is_string($filters)) ? explode('|', $filters) : $filters; } return array();