本文整理汇总了PHP中Symfony\Component\HttpFoundation\Request::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Request::__construct方法的具体用法?PHP Request::__construct怎么用?PHP Request::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Symfony\Component\HttpFoundation\Request
的用法示例。
在下文中一共展示了Request::__construct方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct(array $query = [], array $request = [], array $attributes = [], array $cookies = [], array $files = [], array $server = [], $content = null)
{
parent::__construct($query, $request, $attributes, $cookies, $files, $server, $content);
$this->runMultiLanguage();
$this->runPathBinding();
$this->loadTrustedProxies();
}
示例2: __construct
/**
* @param Request $originalRequest
* @param string $pagePath
* @param integer $pageDefaultValue
* @param string $maxResultsPath
* @param integer $maxResultsDefaultValue
*
* @return PaginatedRequest
*/
public function __construct(Request $originalRequest, $pagePath, $pageDefaultValue, $maxResultsPath, $maxResultsDefaultValue)
{
parent::__construct($originalRequest->query->all(), $originalRequest->request->all(), $originalRequest->attributes->all(), $originalRequest->cookies->all(), $originalRequest->files->all(), $originalRequest->server->all(), $originalRequest->getContent());
$this->pagePath = $pagePath;
$this->pageDefaultValue = $pageDefaultValue;
$this->maxResultsPath = $maxResultsPath;
$this->maxResultsDefaultValue = $maxResultsDefaultValue;
}
示例3: __construct
/**
* Constructor.
*
* Automatically translates JSON raw post data into post parameters.
*/
public function __construct(array $query = array(), array $request = array(), array $attributes = array(), array $cookies = array(), array $files = array(), array $server = array(), $content = null)
{
parent::__construct($query, $request, $attributes, $cookies, $files, $server, $content);
$rawPost = $this->getContent();
if (!empty($rawPost)) {
if (stripos($this->headers->get('Content-Type'), 'application/json') === 0) {
$post = json_decode($rawPost, true);
if ($post && is_array($post)) {
$this->request->add($post);
}
}
}
}
示例4: __construct
public function __construct(array $query = array(), array $request = array(), array $attributes = array(), array $cookies = array(), array $files = array(), array $server = array(), $content = null)
{
parent::__construct($query, $request, $attributes, $cookies, $files, $server, $content);
}
示例5: __construct
/**
* @param BaseRequest $request
*/
public function __construct(BaseRequest $request)
{
parent::__construct(iterator_to_array($request->query), iterator_to_array($request->request), iterator_to_array($request->attributes), iterator_to_array($request->cookies), iterator_to_array($request->files), iterator_to_array($request->server), $request->getContent());
}
示例6: __construct
/**
* @inheritdoc
*/
public function __construct(array $query = [], array $request = [], array $attributes = [], array $cookies = [], array $files = [], array $server = [], $content = null)
{
parent::__construct($query, $request, $attributes, $cookies, $files, $server, $content);
$this->setLocale($this->getPreferredLanguage());
}
示例7: __construct
/**
* The constructor. Sets up a standard request.
*/
public function __construct()
{
//setup the standard request.
parent::__construct($_GET, $_POST, array(), $_COOKIE, $_FILES, $_SERVER);
}
示例8: __construct
/**
* @param array $attributes
* @param array $content
*/
public function __construct(array $attributes, $content)
{
parent::__construct();
$this->attributes = new ParameterBag($attributes);
$this->content = $content;
}
示例9: __construct
public function __construct()
{
parent::__construct($_GET, $_POST, array(), $_COOKIE, $_FILES, $_SERVER);
}
示例10: __construct
/**
* MockTokenRequest constructor.
* @param $serialisedToken
*/
public function __construct($serialisedToken)
{
parent::__construct();
$this->headers->set('Authorization', $serialisedToken);
}
示例11: __construct
/**
* Constructor.
*
* HTTP method overriding using the special `_method` parameter is enabled
* by default in our Request object.
*
* @see \Symfony\Component\HttpFoundation\Request::__construct
* @see \Symfony\Component\HttpFoundation\Request::enableHttpMethodParameterOverride
*/
public function __construct(array $query = array(), array $request = array(), array $attributes = array(), array $cookies = array(), array $files = array(), array $server = array(), $content = null)
{
parent::__construct($query, $request, $attributes, $cookies, $files, $server, $content);
self::enableHttpMethodParameterOverride();
}
示例12: __construct
/**
* @TODO: remove dependency from Request object?
*
* @param Request $request source request
* @param string $media
*/
public function __construct(Request $request, $media = TemplateLayout::MEDIA_SCREEN)
{
parent::__construct($request->query->all(), $request->request->all(), $request->attributes->all(), $request->cookies->all(), $request->files->all(), $request->server->all(), $request->content);
$this->setDefaultLocale($request->getLocale());
$this->media = $media;
}
示例13: ParameterBag
/**
*/
function __construct()
{
parent::__construct();
$this->attributes = new ParameterBag([RequestMeta::ATTRIBUTE_URI => '/uri']);
}