本文整理汇总了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);
}