# HasHttpEquiv

> Provides an immutable API for the http-equiv attribute.

[API reference](/docs/api/index.md) › [HTML Attribute](/docs/extensions/html-attribute/reference/index.md) › HasHttpEquiv

| trait | `UIAwesome\Html\Attribute\HasHttpEquiv` |
| --- | --- |
| Source | [`src/HasHttpEquiv.php`](https://github.com/ui-awesome/html-attribute/blob/main/src/HasHttpEquiv.php#L20) |

Used by 1 type:

- [`UIAwesome\Html\Metadata\Meta`](/docs/extensions/html/reference/metadata/meta/index.md)

Provides an immutable API for the `http-equiv` attribute.

See also: <https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/meta/http-equiv>.

## Methods

| Method | Description | Defined by |
| --- | --- | --- |
| [`httpEquiv()`](#method-httpEquiv) | Sets the `http-equiv` attribute. | `HasHttpEquiv` |

## Method details

### httpEquiv() <span id="method-httpEquiv"></span>

```php
public function httpEquiv(string|Stringable|UnitEnum|null $value): static
```

Sets the `http-equiv` attribute.

Declares the pragma directive for the metadata entry.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$value` | `string\|`[`Stringable`](https://www.php.net/manual/en/class.stringable.php)`\|`[`UnitEnum`](https://www.php.net/manual/en/class.unitenum.php)`\|null` | Pragma directive token, or `null` to remove the attribute. |

**Returns**

`static`: New instance with the updated `http-equiv` attribute. [`HttpEquiv`](/docs/extensions/html-attribute/reference/values/httpequiv/index.md) for predefined enum values.

**Throws**

- [`InvalidArgumentException`](https://www.php.net/manual/en/class.invalidargumentexception.php): If the value is not valid.