本文整理汇总了PHP中HttpResponse::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP HttpResponse::__construct方法的具体用法?PHP HttpResponse::__construct怎么用?PHP HttpResponse::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HttpResponse
的用法示例。
在下文中一共展示了HttpResponse::__construct方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Constructor.
*
* @param ObjectConfig $config An optional ObjectConfig object with configuration options.
*/
public function __construct(ObjectConfig $config)
{
parent::__construct($config);
$this->setRequest($config->request);
$this->setUser($config->user);
//Set the messages
$this->_messages = array();
}
示例2: __construct
public function __construct(array $headers = array())
{
parent::__construct(404, '', $headers);
}
示例3: __construct
public function __construct()
{
parent::__construct();
$this->addHeader('Content-Type', 'application/json');
}
示例4:
function __construct($stream, $status = 302, $delay = 0)
{
parent::__construct($stream, $status);
$this->delay = $delay;
}
示例5: __construct
/**
* @param string $url
* @param array $fields
* @param int $statusCode
* @param string[] $headers
*/
public function __construct($url, array $fields = array(), $statusCode = 200, array $headers = array())
{
$this->url = $url;
$this->fields = $fields;
parent::__construct($this->prepareContent($url, $fields), $statusCode, $headers);
}
示例6: __construct
public function __construct(array $views, $statusCode = 200, $content = '', array $headers = array())
{
parent::__construct($statusCode, $content, $headers);
$this->setViews($views);
}
示例7: __construct
/**
* @param string $content
* @param array $fields
*/
public function __construct($content, array $fields = array())
{
parent::__construct($this->prepareContent($content, $fields));
}
示例8: __construct
public function __construct($statusCode = 200, $content = '', $headers = array())
{
parent::__construct($statusCode, $content, $headers);
$this->setContentType('application/json');
}
示例9: __construct
/**
* @param string $url
* @param int $statusCode
* @param string[] $headers
*/
public function __construct($url, $statusCode = 302, array $headers = array())
{
$this->url = $url;
$headers['Location'] = $url;
parent::__construct($this->prepareContent($url), $statusCode, $headers);
}