Download the PHP package fullscreeninteractive/silverstripe-addressfinder without Composer
On this page you can find all versions of the php package fullscreeninteractive/silverstripe-addressfinder. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download fullscreeninteractive/silverstripe-addressfinder
More information about fullscreeninteractive/silverstripe-addressfinder
Files in fullscreeninteractive/silverstripe-addressfinder
Package silverstripe-addressfinder
Short Description SilverStripe FormField for AddressFinder.co.nz
License BSD-3-Clause
Homepage https://github.com/fullscreeninteractive/silverstripe-addressfinder
Informations about the package silverstripe-addressfinder
AddressFinder for Silverstripe
Maintainer Contact
- Will Rossiter <will (at) fullscreen (dot) io>
Overview
This module provides a custom Silverstripe AddressFinderField
which implements the
javascript AddressFinder widget (1) for address and postcode lookups in New Zealand and Australia.
Getting Started
- Sign up for an NZ account at addressfinder.nz/plans/, or an Australia plan at addressfinder.com.au/plans/
- Set the AddressFinder key via the Silverstripe config system
app/_config/addressfinder.yml
Or, use environment variables if you prefer:
app/_config/addressfinder.yml
Then add an instance of AddressFinderField
to your form fields
This will provide your form with a single text box that provides an autocomplete dropdown as well as a toggle for the user to enter a manual address in the event the API is inaccessible.
The form field provides the saveInto logic for automatically saving into a DataObject model if defined. The fields that the module will save too (if in the database) are
- Address single line representation, should be the name of your field
- PostalLine1
- PostalLine2
- PostalLine3
- PostalLine4
- PostalLine5
- PostalLine6
- Suburb
- City
- Postcode
- Latitude
- Longitude
An example model which will capture all the information from AddressFinder is outlined below:
To prefix these fields, call setFieldPrefix($prefix)
on your AddressFinderField
instance.