Skip to content
PHP Ecosystem
Explore

HasIntegrity

API reference › HTML Attribute › HasIntegrity

traitUIAwesome\Html\Attribute\HasIntegrity
Sourcesrc/HasIntegrity.php
Used by 2 types

Provides an immutable API for the integrity attribute.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/integrity, https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity.

MethodDescriptionDefined by
integrity()Sets the integrity attribute.HasIntegrity
public function integrity(string|Stringable|UnitEnum|null $value): static

Sets the integrity attribute.

Provides the Subresource Integrity hash for the resource.

Parameters

ParameterTypeDescription
$valuestring|Stringable|UnitEnum|nullIntegrity metadata, or null to remove the attribute.

Returns

static: New instance with the updated integrity attribute.