FullscreenInteractive\SilverStripe\AddressFinderField
A wrapper for the AddressFinder API.
Standard layout is a simple text field with the required javascript events,
but as per best practices (http://addressfinder.co.nz/docs/best_practices)
this FormField also provides fallback fields in case the user cannot find
their address
Synopsis
class AddressFinderField
extends TextField
{
- // members
- private static boolean $api_key = false;
- private static boolean $include_address_finder_js = true;
- protected FieldList $manualFields;
- protected TextField $addressField;
- protected HiddenField $manualToggle;
- protected string $fieldPrefix = '';
- protected boolean $showManualFields = true;
- protected boolean $showLatLngManual = false;
- protected boolean $requireLatLngManual = false;
- // methods
- public void __construct()
- public void __clone()
- public $this setShowLatLngManual()
- public $this setRequireLatLngManual()
- public $this setReadonly()
- public $this setError()
- public $this performReadonlyTransformation()
- public $this setDisabled()
- public string FieldHolder()
- public string getApiKey()
- public FieldList getManualFields()
- public $this setShowManualFields()
- public boolean getShowManualFields()
- public TextField getAddressField()
- public void setValue()
- public void saveInto()
- public array dataValue()
- protected string getNestedFieldName()
- public void setFieldPrefix()
- public AddressFinderField setName()
- public bool validate()
Hierarchy
Extends
- SilverStripe\Forms\TextField
Members
private
- $api_key
- $include_address_finder_js
protected
- $addressField — SilverStripe\Forms\TextField
- $fieldPrefix — string
- $manualFields — SilverStripe\Forms\FieldList
- $manualToggle — SilverStripe\Forms\HiddenField
- $requireLatLngManual
- $showLatLngManual
- $showManualFields — boolean
Methods
protected
- getNestedFieldName() — Returns the actual name of a child field without the prefix of this field.
public
- __construct()
- FieldHolder()
- __clone() — Clones
- dataValue()
- getAddressField()
- getApiKey()
- getManualFields()
- getShowManualFields()
- performReadonlyTransformation()
- saveInto()
- setDisabled()
- setError()
- setFieldPrefix() — Set a prefix for the data fields if required. For instance, without a prefix this field save the 'Postcode' as $record->Postcode, if you need to have multiple addresses (i.e Home, Work) or would prefer to have all the address info under a prefix then define one here
- setName()
- setReadonly()
- setRequireLatLngManual()
- setShowLatLngManual()
- setShowManualFields()
- setValue()
- validate() — If this field is required then we require at least the first postal line along with the town and postcode. Either this has been manually filled in or, automatically filled in by