Skip to content
PHP Ecosystem
Explore

HasNonce

API reference › HTML Attribute › Global › HasNonce

traitUIAwesome\Html\Attribute\Global\HasNonce
Sourcesrc/Global/HasNonce.php
Used by 1 type

Provides an immutable API for the nonce attribute.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Global_attributes/nonce.

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

Sets the nonce attribute.

Parameters

ParameterTypeDescription
$valuestring|Stringable|UnitEnum|nullCryptographic nonce value, or null to remove the attribute.

Returns

static: New instance with the updated nonce attribute.