Symfony\Bundle\FrameworkBundle\Controller\Controller::redirect PHP Method

redirect() protected method

Returns a RedirectResponse to the given URL.
protected redirect ( string $url, integer $status = 302 ) : RedirectResponse
$url string The URL to redirect to
$status integer The status code to use for the Response
return Symfony\Component\HttpFoundation\RedirectResponse
    protected function redirect($url, $status = 302)
    {
        return new RedirectResponse($url, $status);
    }

Usage Example

Example #1
0
 public function redirect($url, $status = 302)
 {
     if ($url instanceof Request) {
         $url = $this->generateUrl($url);
     }
     return parent::redirect($url, $status);
 }
All Usage Examples Of Symfony\Bundle\FrameworkBundle\Controller\Controller::redirect