Download the PHP package burnbright/silverstripe-regionaldata without Composer
On this page you can find all versions of the php package burnbright/silverstripe-regionaldata. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download burnbright/silverstripe-regionaldata
More information about burnbright/silverstripe-regionaldata
Files in burnbright/silverstripe-regionaldata
Package silverstripe-regionaldata
Short Description Provides country and country subdivision datamodels, along with data.
License BSD-2-Clause
Informations about the package silverstripe-regionaldata
Regional Data Module
Provides reusable models, data, and fields for hierarichal geographical region classification of countries, and their subdivisons. The module should help to close the gap between known data, and arbitrary (possibly invalid) data entered by visitors.
A strong focus has been put on following the ISO 3166 standard.
This module is not intended to replace zend_locale.
Installation
- Unzip to your silverstripe root / regionaldata.
- Visit yoursite.tld/dev/tasks/LoadRegionalData
You should now be able to see countries and subdivisions in yoursite.tld/admin/regions
Possible Uses
- Auto-completion country and state fields
- Drop-down fields for entering valid data
- Connect with other models for regionalisation
- Addressing systems
Javascript Field Updater
Require the following script to templates / forms which have Country and State fields:
regionaldata/javascript/updater.jquery.js
If you are using the shop module, a good place to include this is in an extension of Address
:
Provided Data Set
2nd level subdivisons have different names, eg: area, district, parish, county.
Most data has been sourced from commondatahub.com.
In the provided dataset, some countries have multiple types of subregion. There aer about 100 different subregions all toegether. In one case (United Kingdom), 11 types of sub region are present. This results in a very confusing 'Region/State' dropdown.You will probably not want to make every type available to users, so some cleanup will be needed.
This query will identify every type of sub region:
Running this query will show the countries with multiple subregion types:
Future TODO / Ideas
- Write a SQL query to clean up data set
- Store address formats. Some countries don't require all address fields, others do.
- Translation of names
- 3rd-level post/zip code storage model