Final Class Yiisoft\HttpMiddleware\HttpCache\ETagHeader
| Inheritance | Yiisoft\HttpMiddleware\HttpCache\ETagHeader |
|---|
Public Methods
| Method | Description | Defined By |
|---|---|---|
| __construct() | Yiisoft\HttpMiddleware\HttpCache\ETagHeader | |
| headerValue() | Returns the ETag value formatted for use in HTTP headers. | Yiisoft\HttpMiddleware\HttpCache\ETagHeader |
| rawValue() | Returns the raw ETag value generated from the seed. | Yiisoft\HttpMiddleware\HttpCache\ETagHeader |
Method Details
public function __construct(
private readonly ETag $eTag,
private readonly ETagGeneratorInterface $generator,
) {
}
Returns the ETag value formatted for use in HTTP headers.
The value is enclosed in double quotes and prefixed with 'W/' if the ETag is weak.
| public string headerValue ( ) | ||
| return | string |
The formatted ETag header value. |
|---|---|---|
public function headerValue(): string
{
$value = '"' . $this->rawValue() . '"';
if ($this->eTag->weak) {
$value = 'W/' . $value;
}
return $value;
}
Signup or Login in order to comment.