mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-01 12:42:48 +08:00
改进response助手函数 改进Response类的header方法 支持批量设置
This commit is contained in:
@@ -216,13 +216,17 @@ class Response
|
||||
/**
|
||||
* 设置响应头
|
||||
* @access public
|
||||
* @param string $name 参数名
|
||||
* @param string|array $name 参数名
|
||||
* @param string $value 参数值
|
||||
* @return $this
|
||||
*/
|
||||
public function header($name, $value)
|
||||
public function header($name, $value = null)
|
||||
{
|
||||
$this->header[$name] = $value;
|
||||
if (is_array($name)) {
|
||||
$this->header = $name;
|
||||
} else {
|
||||
$this->header[$name] = $value;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user