2017 © Pedro Peláez
 

silverstripe-vendormodule countries

SilverWare Countries Module.

image

silverware/countries

SilverWare Countries Module.

  • Sunday, October 8, 2017
  • by PraxisNetAu
  • Repository
  • 1 Watchers
  • 2 Stars
  • 290 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 7 Versions
  • 22 % Grown

The README.md

SilverWare Countries Module

Latest Stable Version Latest Unstable Version License, (*1)

Provides a CountryDropdownField for use in SilverStripe v4 forms., (*2)

Contents

Background

SilverStripe decided to remove CountryDropdownField from framework in v4, which can be a pretty handy field when you need an international address entered into a form. This module provides a replacement field, with similar configuration options to the original., (*3)

Requirements

Installation

Installation is via Composer:, (*4)

$ composer require silverware/countries

Configuration

As with all SilverStripe modules, configuration is via YAML. There are three configuration options available for CountryDropdownField:, (*5)

  • default_to_locale - default setting is false; if set to true, the default value for the field will be based on either the locale of the current user, or the default locale for the app (obtained from i18n).
  • default_country - default setting is null; defines the country code to use as the default value if default_to_locale is set to false.
  • invalid_countries - defines a list of country codes which are considered invalid and are removed from the default source data.

Differences from Original Class

Note: default_to_locale and default_country in this module are different from the original SilverStripe field. The original class had default_to_locale set to true, and default_country set to NZ., (*6)

You can still set these defaults through configuration if you wish, however I figured it would be better to not make assumptions about locale or country by default. More often than not these defaults were overridden for projects using the original field., (*7)

Usage

To make use of the field within your code, simply use the class within the header of your file:, (*8)

use SilverWare\Countries\Forms\CountryDropdownField;

You can then create an instance of the field within your form code:, (*9)

CountryDropdownField::create('MyCountryCode', 'Country');

Issues

Please use the GitHub issue tracker for bug reports and feature requests., (*10)

Contribution

Your contributions are gladly welcomed to help make this project better. Please see contributing for more information., (*11)

Maintainers

Colin Tucker Praxis Interactive
Colin Tucker Praxis Interactive

License

BSD-3-Clause © Praxis Interactive, (*12)

The Versions

08/10 2017

dev-master

9999999-dev https://github.com/praxisnetau/silverware-countries

SilverWare Countries Module.

  Sources   Download

BSD-3-Clause

The Requires

 

dropdown silverstripe field country countries silverware

08/10 2017

1.0.2

1.0.2.0 https://github.com/praxisnetau/silverware-countries

SilverWare Countries Module.

  Sources   Download

BSD-3-Clause

The Requires

 

dropdown silverstripe field country countries silverware

07/10 2017

1.0.1

1.0.1.0 https://github.com/praxisnetau/silverware-countries

SilverWare Countries Module.

  Sources   Download

BSD-3-Clause

The Requires

 

dropdown silverstripe field country countries silverware

15/06 2017

1.0.0

1.0.0.0 https://github.com/praxisnetau/silverware-countries

SilverWare Countries Module.

  Sources   Download

BSD-3-Clause

The Requires

 

dropdown silverstripe field country countries silverware

06/06 2017

0.1.2

0.1.2.0 https://github.com/praxisnetau/silverware-countries

SilverWare Countries Module.

  Sources   Download

BSD-3-Clause

The Requires

 

dropdown silverstripe field country countries silverware

06/06 2017

0.1.1

0.1.1.0 https://github.com/praxisnetau/silverware-countries

SilverWare Countries Module.

  Sources   Download

BSD-3-Clause

The Requires

 

dropdown silverstripe field country countries silverware

06/06 2017

0.1.0

0.1.0.0 https://github.com/praxisnetau/silverware-countries

SilverWare Countries Module.

  Sources   Download

BSD-3-Clause

The Requires

 

dropdown silverstripe field country countries silverware