HasRel
API reference › HTML Attribute › HasRel
Provides an immutable API for the rel attribute.
See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/rel.
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
rel() | Sets the rel attribute. | HasRel |
Method details
Section titled “Method details”rel()
Section titled “rel() ”public function rel(string|Stringable|UnitEnum|null $value): staticSets the rel attribute.
Defines the relationship between the current document and the linked resource.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | string|Stringable|UnitEnum| | Link type token, or null to remove the attribute. |
Returns
static: New instance with the updated rel attribute. Rel for predefined enum values.
Throws
InvalidArgumentException: If the value is not valid.