Pass status when redirecting to route.

This commit is contained in:
Taylor Otwell 2011-11-11 11:52:45 -06:00
parent c11ee76511
commit 0b3ecf8973
1 changed files with 4 additions and 2 deletions

View File

@ -81,14 +81,16 @@ public static function __callStatic($method, $parameters)
{
$parameters = (isset($parameters[0])) ? $parameters[0] : array();
$status = (isset($parameters[1])) ? $parameters[1] : 302;
if (strpos($method, 'to_secure_') === 0)
{
return static::to(URL::to_route(substr($method, 10), $parameters, true));
return static::to(URL::to_route(substr($method, 10), $parameters, true), $status);
}
if (strpos($method, 'to_') === 0)
{
return static::to(URL::to_route(substr($method, 3), $parameters));
return static::to(URL::to_route(substr($method, 3), $parameters), $status);
}
throw new \Exception("Method [$method] is not defined on the Redirect class.");