PlaceholderInterface
API reference › HTML Contracts › Form › PlaceholderInterface
Implemented by 8 types
Defines the contract for form controls that expose the placeholder attribute.
Applies to controls that display a short hint describing the expected value before the user enters data.
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
placeholder() abstract | Sets the placeholder attribute. | PlaceholderInterface |
Method details
Section titled “Method details”placeholder()
Section titled “placeholder() ”abstract public function placeholder(string|Stringable|UnitEnum|null $value): staticSets the placeholder attribute.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | string|Stringable|UnitEnum| | Expected-value hint, or null to remove the attribute. |
Returns
static: New instance with the updated placeholder attribute.