Browse Source

Merge pull request #359 from akuzemchak/feature/load-route

Load designated route's response
Taylor Otwell 12 years ago
parent
commit
6e82a4ac8d
1 changed files with 12 additions and 0 deletions
  1. 12 0
      laravel/routing/route.php

+ 12 - 0
laravel/routing/route.php

@@ -380,5 +380,17 @@ class Route {
 	{
 		Filter::register($name, $callback);
 	}
+	
+	/**
+	 * Calls the specified route and returns its response.
+	 *
+	 * @param  string    $method
+	 * @param  string    $uri
+	 * @return Response
+	 */
+	public static function load($method, $uri)
+	{
+		return Router::route(strtoupper($method), $uri)->call();
+	}
 
 }