added url::home

This commit is contained in:
Taylor Otwell
2012-02-15 08:27:10 -06:00
parent 75280a9fea
commit 188394bae1
2 changed files with 22 additions and 11 deletions

View File

@@ -11,17 +11,7 @@ class Redirect extends Response {
*/
public static function home($status = 302, $https = false)
{
$route = Router::find('home');
// If a route named "home" exists, we'll route to that instead of using
// the single slash root URI. THis allows the HTTPS attribute to be
// respected instead of being hard-coded in the redirect.
if ( ! is_null($route))
{
return static::to_route('home', $status);
}
return static::to('/', $status, $https);
return static::to(URL::home($https), $status);
}
/**