HasDir
API reference › HTML Attribute › Global › HasDir
Used by 4 types
Provides an immutable API for the dir attribute.
See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/dir.
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
dir() | Sets the dir attribute. | HasDir |
Method details
Section titled “Method details”dir()
Section titled “dir() ”public function dir(string|UnitEnum|null $value): staticSets the dir attribute.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | string|UnitEnum| | Directionality value. Use ‘ltr’, ‘rtl’, or ‘auto’, or null to remove the attribute. |
Returns
static: New instance with the updated dir attribute. Direction for predefined enum values.
Throws
InvalidArgumentException: If the value is not valid.