working on routing architecture.

This commit is contained in:
Taylor Otwell
2011-07-31 21:51:55 -05:00
parent 344f49e1bf
commit 0af326b636
6 changed files with 59 additions and 22 deletions

View File

@@ -135,6 +135,11 @@ if (System\Config::get('session.driver') != '')
System\Session::load(System\Cookie::get('laravel_session'));
}
// --------------------------------------------------------------
// Register the route filters.
// --------------------------------------------------------------
System\Routing\Filter::register(require APP_PATH.'filters'.EXT);
// --------------------------------------------------------------
// Execute the global "before" filter.
// --------------------------------------------------------------
@@ -145,7 +150,7 @@ $response = System\Routing\Filter::call('before', array(), true);
// ----------------------------------------------------------
if (is_null($response))
{
$route = System\Routing\Router::make(Request::method(), Request::uri())->route();
$route = System\Routing\Router::make(Request::method(), Request::uri(), new System\Routing\Loader)->route();
$response = (is_null($route)) ? System\Response::make(System\View::make('error/404'), 404) : $route->call();
}