refactoring routing and comments.

This commit is contained in:
Taylor Otwell
2011-10-15 14:04:11 -05:00
parent a44ca9d53b
commit a6eaa06981
20 changed files with 368 additions and 265 deletions

View File

@@ -104,19 +104,24 @@ class Route {
{
if ($response instanceof Delegate)
{
return $response;
return Controller::call($response, $this->parameters);
}
else
{
// The after filter and the framework expects all responses to
// be instances of the Response class. If the route did not
// return an instsance of Response, we will make on now.
if ( ! $response instanceof Response) $response = new Response($response);
$filters = array_merge($this->filters('after'), array('after'));
$filters = array_merge($this->filters('after'), array('after'));
Filter::run($filters, array($response));
Filter::run($filters, array($response));
return $response;
}
else
{
return Response::error('404');
return $response;
}
}
return Response::error('404');
}
/**