HasMicroData
API reference › HTML Attribute › Global › HasMicroData
Used by 1 type
Provides an immutable API for microdata attributes.
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
itemId() | Sets the itemid attribute. | HasMicroData |
itemProp() | Sets the itemprop attribute. | HasMicroData |
itemRef() | Sets the itemref attribute. | HasMicroData |
itemScope() | Sets the itemscope attribute. | HasMicroData |
itemType() | Sets the itemtype attribute. | HasMicroData |
Method details
Section titled “Method details”itemId()
Section titled “itemId() ”public function itemId(string|Stringable|UnitEnum|null $value): staticSets the itemid attribute.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | string|Stringable|UnitEnum| | Microdata item ID, or null to remove the attribute. |
Returns
static: New instance with the updated itemid attribute.
See also
itemProp()
Section titled “itemProp() ”public function itemProp(string|Stringable|UnitEnum|null $value): staticSets the itemprop attribute.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | string|Stringable|UnitEnum| | Microdata item property, or null to remove the attribute. |
Returns
static: New instance with the updated itemprop attribute.
See also
itemRef()
Section titled “itemRef() ”public function itemRef(string|Stringable|UnitEnum|null $value): staticSets the itemref attribute.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | string|Stringable|UnitEnum| | Microdata item reference, or null to remove the attribute. |
Returns
static: New instance with the updated itemref attribute.
See also
itemScope()
Section titled “itemScope() ”public function itemScope(bool|null $value): staticSets the itemscope attribute.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | bool| | Whether to enable itemscope, or null to remove the attribute. |
Returns
static: New instance with the updated itemscope attribute.
See also
itemType()
Section titled “itemType() ”public function itemType(string|Stringable|UnitEnum|null $value): staticSets the itemtype attribute.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | string|Stringable|UnitEnum| | Microdata item type, or null to remove the attribute. |
Returns
static: New instance with the updated itemtype attribute.
See also