Trait Yiisoft\DataResponse\ResponseContentTrait
ResponseContentTrait provides methods for manipulating the response content.
Public Methods
| Method | Description | Defined By |
|---|---|---|
| withContentType() | Returns a new instance with the specified content type. | Yiisoft\DataResponse\ResponseContentTrait |
| withEncoding() | Returns a new instance with the specified encoding. | Yiisoft\DataResponse\ResponseContentTrait |
Method Details
Returns a new instance with the specified content type.
| public self withContentType ( string $contentType ) | ||
| $contentType | string |
The content type. For example, "text/html". |
public function withContentType(string $contentType): self
{
$new = clone $this;
$new->contentType = $contentType;
return $new;
}
Returns a new instance with the specified encoding.
| public self withEncoding ( string $encoding ) | ||
| $encoding | string |
The encoding. For example, "UTF-8". |
public function withEncoding(string $encoding): self
{
$new = clone $this;
$new->encoding = $encoding;
return $new;
}
Signup or Login in order to comment.