Skip to content
PHP Ecosystem
Explore

HasTranslate

API reference › HTML Attribute › Global › HasTranslate

traitUIAwesome\Html\Attribute\Global\HasTranslate
Sourcesrc/Global/HasTranslate.php
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.

MethodDescriptionDefined by
translate()Sets the translate attribute.HasTranslate
public function translate(bool|string|UnitEnum|null $value): static

Sets the translate attribute.

Parameters

ParameterTypeDescription
$valuebool|string|UnitEnum|nullTranslation 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