Address - viames/pair GitHub Wiki
Pair framework: Address
Pair\Html\FormControls\Address renders a text input specialized for address entry.
Main behavior
- Renders
<input type="text">. - Automatically adds CSS class
googlePlacesAutocomplete. - Sets
size="50"andautocomplete="on". - Supports
minLength()andmaxLength()inherited fromFormControl.
Methods
render(): string- Inherited methods from FormControl:
id(),label(),required(),placeholder(),value(),class(),data(),aria(),validate().
Validation
No custom validator is defined. Validation uses FormControl::validate() (required, minLength, maxLength).
Example
$address = (new \Pair\Html\FormControls\Address('shippingAddress'))
->label('Shipping address')
->placeholder('Via Roma 10, Milano')
->required()
->minLength(10)
->maxLength(255);
echo $address->render();
Notes
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.