__construct() public method

Creates a redirect response so that it conforms to the rules defined for a redirect status code.
See also: http://tools.ietf.org/html/rfc2616#section-10.3
public __construct ( string $url, integer $status = 302 )
$url string The URL to redirect to
$status integer The status code (302 by default)
Esempio n. 1
0
 /**
  * @param Request $request
  * @param View $view
  * @param Session $session
  * @param array|string $url
  * @param int $status
  * @param array $headers
  */
 public function __construct(Request $request, View $view, Session $session, $url = ROOT, $status = 302, $headers = array())
 {
     $this->request = $request;
     $this->view = $view;
     $this->session = $session;
     parent::__construct($url, $status, $headers);
 }
 /**
  * Creates a redirect response so that it conforms to the rules defined for a redirect status code.
  *
  * @param string  $url    The URL to redirect to
  * @param integer $status The status code (302 by default)
  * @param Cookie  $cookie An array of Cookie objects
  */
 public function __construct($url, $status = 302, $cookie = 'full')
 {
     parent::__construct($url, $status);
     if (!$cookie instanceof Cookie) {
         throw new \InvalidArgumentException(sprintf('Third parameter is not a valid Cookie object.'));
     }
     $this->headers->setCookie($cookie);
 }
 /**
  * Creates a redirect response so that it conforms to the rules defined for a redirect status code.
  *
  * @param string  $url    The URL to redirect to
  * @param integer $status The status code (302 by default)
  * @param array   $cookies An array of Cookie objects
  */
 public function __construct($url, $status = 302, $cookies = array())
 {
     parent::__construct($url, $status);
     foreach ($cookies as $cookie) {
         if (!$cookie instanceof Cookie) {
             throw new \InvalidArgumentException(sprintf('One of third parameter array is not a valid Cookie object.'));
         }
         $this->headers->setCookie($cookie);
     }
 }
 /**
  * @param \Laelaps\Bundle\Facebook\FacebookAdapter $facebookAdapter
  * @param array $permissions
  */
 public function __construct(FacebookAdapter $facebookAdapter, array $permissions = [])
 {
     $redirectUrl = $facebookAdapter->getLoginUrl(['scope' => $permissions]);
     parent::__construct($redirectUrl);
 }
Esempio n. 5
0
 public function __construct($url, $status = 302, $headers = array())
 {
     $url = (string) $url;
     // sometimes we get an object.
     parent::__construct($url, $status, $headers);
 }
 public function __construct(Request $request, $status = 302, $headers = [])
 {
     parent::__construct($request->headers->get('referer'), $status, $headers);
 }
 public function __construct($url, array $headers = [])
 {
     parent::__construct($url, self::HTTP_RESET_CONTENT, $headers);
 }
Esempio n. 8
0
 /**
  * Constructor
  *
  * @param string $url
  * @param int $session
  * @param array $paReq
  */
 public function __construct($url, $session, $paReq)
 {
     parent::__construct($url);
     $this->setPaReq($paReq);
     $this->setSession($session);
 }