Skip to content

Commit

Permalink
Merge pull request #856 from maldoinc/patch-1
Browse files Browse the repository at this point in the history
adds redirectTo method
  • Loading branch information
silentworks committed Dec 9, 2014
2 parents fe1c215 + 7011de3 commit 04958a1
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Slim/Slim.php
Original file line number Diff line number Diff line change
Expand Up @@ -1099,6 +1099,18 @@ public function redirect($url, $status = 302)
$this->response->redirect($url, $status);
$this->halt($status);
}

/**
* RedirectTo
*
* Redirects to a specific named route
*
* @param string $route The route name
* @param array $params Associative array of URL parameters and replacement values
*/
public function redirectTo($route, $params = array(), $status = 302){
$this->redirect($this->urlFor($route, $params), $status);
}

/********************************************************************************
* Flash Messages
Expand Down

0 comments on commit 04958a1

Please sign in to comment.