PHPackages                             fullscreeninteractive/silverstripe-addressfinder - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. fullscreeninteractive/silverstripe-addressfinder

ActiveSilverstripe-vendormodule[Utility &amp; Helpers](/categories/utility)

fullscreeninteractive/silverstripe-addressfinder
================================================

SilverStripe FormField for AddressFinder.co.nz

3.0.0(3mo ago)011.5k↑760%2BSD-3-ClausePHPCI failing

Since May 8Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/fullscreeninteractive/silverstripe-addressfinder)[ Packagist](https://packagist.org/packages/fullscreeninteractive/silverstripe-addressfinder)[ Docs](https://github.com/fullscreeninteractive/silverstripe-addressfinder)[ RSS](/packages/fullscreeninteractive-silverstripe-addressfinder/feed)WikiDiscussions main Synced today

READMEChangelog (6)Dependencies (6)Versions (16)Used By (0)

AddressFinder for Silverstripe
==============================

[](#addressfinder-for-silverstripe)

[![Scrutinizer Code Quality](https://camo.githubusercontent.com/bd30aa7f2b15c65f205f2a8f57f7d82b0a62ee72c379b93974254851f622bedb/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f66756c6c73637265656e696e7465726163746976652f73696c7665727374726970652d6164647265737366696e6465722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/fullscreeninteractive/silverstripe-addressfinder/?branch=master)[![Latest Stable Version](https://camo.githubusercontent.com/24cbf7e39423828f1d66a665b945bcbe8b528e4da33ebfa5ea9c06770330db2e/68747470733a2f2f706f7365722e707567782e6f72672f66756c6c73637265656e696e7465726163746976652f73696c7665727374726970652d6164647265737366696e6465722f762f737461626c65)](https://packagist.org/packages/fullscreeninteractive/silverstripe-addressfinder)

Maintainer Contact
------------------

[](#maintainer-contact)

- Will Rossiter &lt;will (at) fullscreen (dot) io&gt;

Overview
--------

[](#overview)

This module provides a custom Silverstripe `AddressFinderField` which implements the javascript AddressFinder widget ([1](http://addressfinder.co.nz/docs/widget_docs)) for address and postcode lookups in New Zealand and Australia.

Getting Started
---------------

[](#getting-started)

```
composer require fullscreeninteractive/silverstripe-addressfinder

```

- Sign up for an NZ account at [addressfinder.nz/plans/](https://www.addressfinder.nz/plans/), or an Australia plan at [addressfinder.com.au/plans/](https://www.addressfinder.com.au/plans/)
- Set the AddressFinder key via the Silverstripe config system

*app/\_config/addressfinder.yml*

```
FullscreenInteractive\SilverStripe\AddressFinderField:
  api_key: 123

```

Or, use environment variables if you prefer:

*app/\_config/addressfinder.yml*

```
FullscreenInteractive\SilverStripe\AddressFinderField:
  api_key: '`ADDRESS_FINDER_KEY`'

```

Then add an instance of `AddressFinderField` to your form fields

```
use FullscreenInteractive\SilverStripe\AddressFinderField;

$fields->push(new AddressFinderField('Address'));

```

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:

```
