Example #1
0
 public function setRedirectToRoute(Route $route, $args = array(), Request $context = null)
 {
     // set up the response to redirect to a named route
     if (!$route) {
         return;
     }
     // generate the url for the route
     $url = $route->generate($args);
     // add the domain if we can
     if ($context) {
         $url = $context->getHttpHost() . $url;
     }
     // Finally, set the redirect headers
     $this->setRedirectToURL($url);
 }