Skip to content
PHP Ecosystem
Explore

HasPattern

API reference › HTML › Form › Mixin › HasPattern

traitUIAwesome\Html\Form\Mixin\HasPattern
Sourcesrc/Form/Mixin/HasPattern.php
Used by 6 types

Provides an immutable API for the pattern attribute.

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

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

Sets the pattern attribute.

Parameters

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

Returns

static: New instance with the updated pattern attribute.