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