本文整理匯總了PHP中Symfony\Component\HttpFoundation\RedirectResponse::__construct方法的典型用法代碼示例。如果您正苦於以下問題:PHP RedirectResponse::__construct方法的具體用法?PHP RedirectResponse::__construct怎麽用?PHP RedirectResponse::__construct使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Symfony\Component\HttpFoundation\RedirectResponse
的用法示例。
在下文中一共展示了RedirectResponse::__construct方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: __construct
/**
* @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);
}
示例2: __construct
/**
* 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);
}
示例3: __construct
/**
* 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);
}
}
示例4: __construct
/**
* @param \Laelaps\Bundle\Facebook\FacebookAdapter $facebookAdapter
* @param array $permissions
*/
public function __construct(FacebookAdapter $facebookAdapter, array $permissions = [])
{
$redirectUrl = $facebookAdapter->getLoginUrl(['scope' => $permissions]);
parent::__construct($redirectUrl);
}
開發者ID:kl3ryk,項目名稱:symfony-facebook-authentication-bundle,代碼行數:9,代碼來源:FacebookLoginUrlRedirectResponse.php
示例5: __construct
public function __construct($url, $status = 302, $headers = array())
{
$url = (string) $url;
// sometimes we get an object.
parent::__construct($url, $status, $headers);
}
示例6: __construct
public function __construct(Request $request, $status = 302, $headers = [])
{
parent::__construct($request->headers->get('referer'), $status, $headers);
}
示例7: __construct
public function __construct($url, array $headers = [])
{
parent::__construct($url, self::HTTP_RESET_CONTENT, $headers);
}
示例8: __construct
/**
* 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);
}