From a045496684c92a46d46b9d8b8aed690346a5c336 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Thu, 25 Aug 2011 23:17:11 -0500 Subject: [PATCH] pass request into route closures. --- application/routes.php | 2 +- laravel/routing/handler.php | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/application/routes.php b/application/routes.php index 94efd50d..2f1372c8 100644 --- a/application/routes.php +++ b/application/routes.php @@ -37,7 +37,7 @@ return array( | */ - 'GET /' => function() + 'GET /' => function($request) { return View::make('home.index'); }, diff --git a/laravel/routing/handler.php b/laravel/routing/handler.php index d391840d..91e1197d 100644 --- a/laravel/routing/handler.php +++ b/laravel/routing/handler.php @@ -95,6 +95,8 @@ class Handler { */ 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))