Skip to content
PHP Ecosystem
Explore

HasPlaceholder

API reference › HTML › Form › Mixin › HasPlaceholder

traitUIAwesome\Html\Form\Mixin\HasPlaceholder
Sourcesrc/Form/Mixin/HasPlaceholder.php
Used by 7 types

Provides an immutable API for the placeholder attribute.

Satisfies PlaceholderInterface for the controls that declare it.

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

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

Sets the placeholder attribute.

Parameters

ParameterTypeDescription
$valuestring|Stringable|UnitEnum|nullPlaceholder text, or null to remove the attribute.

Returns

static: New instance with the updated placeholder attribute.