-
Notifications
You must be signed in to change notification settings - Fork 2
Address
Viames Marino edited this page Mar 26, 2026
·
3 revisions
Pair\Html\FormControls\Address renders a text input specialized for address entry.
- Renders
<input type="text">. - Automatically adds CSS class
googlePlacesAutocomplete. - Sets
size="50"andautocomplete="on". - Supports
minLength()andmaxLength()inherited fromFormControl.
render(): string- Inherited methods from FormControl:
id(),label(),required(),placeholder(),value(),class(),data(),aria(),validate().
No custom validator is defined. Validation uses FormControl::validate() (required, minLength, maxLength).
$address = (new \Pair\Html\FormControls\Address('shippingAddress'))
->label('Shipping address')
->placeholder('Via Roma 10, Milano')
->required()
->minLength(10)
->maxLength(255);
echo $address->render();Address is still a plain text input. Geocoding/autocomplete behavior depends on frontend JS/CSS integration.
For an explicit Google Maps integration with hidden metadata fields, use GoogleAddress.
See also: FormControl, Text, Form.