Adds configurable address fields to an object, and provides automatic geocoding.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
_config
docs/en
src
templates/Symbiote/Addressable
tests
.editorconfig
.gitattributes
.scrutinizer.yml
.travis.yml
.upgrade.yml
CHANGELOG.md Fix Tests, Add PSR-2 formatting and add comments surrounding function… Jul 25, 2018
CONTRIBUTING.md
LICENSE.md
README.md
_config.php
composer.json
phpcs.xml.dist
phpunit.xml.dist

README.md

Addressable

Build Status Latest Stable Version Latest Unstable Version Total Downloads License

Adds address fields to a DataObject and also has support for automatic geocoding of the provided address.

CMS screenshot

Composer Install

composer require symbiote/silverstripe-addressable:~4.0

Requirements

  • SilverStripe 4.0+

Documentation

Changes from SilverStripe 3.X

  • GoogleGeocoding changed class name to Symbiote\Addressable\GeocodeService
    • The static method address_to_point was changed to a non-static method called addressToPoint. This allows you to use the Injector and replace GeocodeService with something else if you need to.
  • Addressable::set_allowed_states(array('' => '', 'NSW' => "New South Wales")); has been deprecated in favour of config values.
  • Addressable::set_allowed_countries(array('' => '', 'AU' => "Australia")); has been deprecated in favour of config values.
  • Addressable::set_postcode_regex(...); has been deprecated in favour of config values.
    • Addressable::set_postcode_regex config value has been deprecated in favour of Addressable::postcode_regex
      • NOTE: Previously there was a hack in Addressable that read Addressable::set_postcode_regex config value, then called Addressable::set_postcode_regex() to update the protected static postcode_regex; value in the Addressable __construct() method.

Credits

  • Mark Taylor for adding the ability to easily embed a map with AddressMap
  • Nic for writing tests for this module
  • AJ Short for initially writing this module