pass request into route closures.
This commit is contained in:
parent
e0a9f57515
commit
a045496684
|
@ -37,7 +37,7 @@
|
|||
|
|
||||
*/
|
||||
|
||||
'GET /' => function()
|
||||
'GET /' => function($request)
|
||||
{
|
||||
return View::make('home.index');
|
||||
},
|
||||
|
|
|
@ -95,6 +95,8 @@ protected function find_route_closure(Route $route)
|
|||
*/
|
||||
protected function handle_closure(Route $route, Closure $closure)
|
||||
{
|
||||
array_unshift($route->parameters, $this->request);
|
||||
|
||||
$response = call_user_func_array($closure, $route->parameters);
|
||||
|
||||
if (is_array($response))
|
||||
|
|
Loading…
Reference in New Issue