Save address information based on the AddressFinderNZ API into DataObject fields.
A custom field for integrating the AddressFinderNZ API as both a backend and frontend field.
AddressFinderField::create(DataObject $data, $name, $title = null, $databaseFields = array(), $hiddenFields = false)
By default the field will pull the full address from the API and will save it into the database field 'Address'.
Alternatively you can specifiy multiple fields from the API to be saved to the database. You can do this by passing in the alternative database fields array as the 3rd variable of the field constructor.
The key of the array is the database field and the value should match the meta data returned by the API.
This installer requires you have the following:
AddressFinderField: Key: 'key-here' Secret: 'secret-here'
private static $db = array( 'Address' => 'Text' );
AddressFinderField::create($this, 'AddressFinder', 'Search address')
private static $db = array( 'Address' => 'Text', 'City' => 'Varchar', 'Street' => 'Varchar' );
$addressConfig = array( 'Address' => 'a', 'City' => 'city', 'Street' => 'street' );
AddressFinderField::create($this, 'AddressFinder', 'Search address', $addressConfig)
AddressFinderField::create($this->data(), 'AddressFinder', 'Address Finder', $addressConfig, false)
Module rating system helping users find modules that are well supported. For more on how the rating system works visit Module standards
Score not correct? Let us know there is a problem