PHPackages                             silverware/countries - 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. silverware/countries

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

silverware/countries
====================

SilverWare Countries Module.

1.0.2(8y ago)25.6k3[1 PRs](https://github.com/praxisnetau/silverware-countries/pulls)3BSD-3-ClausePHPPHP &gt;=5.6.0

Since Jun 6Pushed 2y ago1 watchersCompare

[ Source](https://github.com/praxisnetau/silverware-countries)[ Packagist](https://packagist.org/packages/silverware/countries)[ Docs](https://github.com/praxisnetau/silverware-countries)[ RSS](/packages/silverware-countries/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (1)Versions (7)Used By (3)

SilverWare Countries Module
===========================

[](#silverware-countries-module)

[![Latest Stable Version](https://camo.githubusercontent.com/44871d99bd59b4b44515ea8ef8ed6898eace08972eab0062037ce90677f49c8d/68747470733a2f2f706f7365722e707567782e6f72672f73696c766572776172652f636f756e74726965732f762f737461626c65)](https://packagist.org/packages/silverware/countries)[![Latest Unstable Version](https://camo.githubusercontent.com/e2c7008aec4e116542d58f1f613fecc8fe19b279f5072f9b05e00bc7cffa38d3/68747470733a2f2f706f7365722e707567782e6f72672f73696c766572776172652f636f756e74726965732f762f756e737461626c65)](https://packagist.org/packages/silverware/countries)[![License](https://camo.githubusercontent.com/3ae0b87cf1701d2195e7b7d4f51cb9dd1f47d5143160589e265e83f7aa128453/68747470733a2f2f706f7365722e707567782e6f72672f73696c766572776172652f636f756e74726965732f6c6963656e7365)](https://packagist.org/packages/silverware/countries)

Provides a `CountryDropdownField` for use in [SilverStripe v4](https://github.com/silverstripe/silverstripe-framework) forms.

Contents
--------

[](#contents)

- [Background](#background)
- [Requirements](#requirements)
- [Installation](#installation)
- [Configuration](#configuration)
- [Usage](#usage)
- [Issues](#issues)
- [Contribution](#contribution)
- [Maintainers](#maintainers)
- [License](#license)

Background
----------

[](#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](#configuration) options to the original.

Requirements
------------

[](#requirements)

- [SilverStripe Framework v4](https://github.com/silverstripe/silverstripe-framework)

Installation
------------

[](#installation)

Installation is via [Composer](https://getcomposer.org):

```
$ composer require silverware/countries

```

Configuration
-------------

[](#configuration)

As with all SilverStripe modules, configuration is via YAML. There are three configuration options available for `CountryDropdownField`:

- `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

[](#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`.

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.

Usage
-----

[](#usage)

To make use of the field within your code, simply `use` the class within the header of your file:

```
use SilverWare\Countries\Forms\CountryDropdownField;
```

You can then create an instance of the field within your form code:

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

Issues
------

[](#issues)

Please use the [GitHub issue tracker](https://github.com/praxisnetau/silverware-countries/issues) for bug reports and feature requests.

Contribution
------------

[](#contribution)

Your contributions are gladly welcomed to help make this project better. Please see [contributing](CONTRIBUTING.md) for more information.

Maintainers
-----------

[](#maintainers)

[![Colin Tucker](https://avatars3.githubusercontent.com/u/1853705?s=144)](https://github.com/colintucker)[![Praxis Interactive](https://avatars2.githubusercontent.com/u/1782612?s=144)](http://www.praxis.net.au)[Colin Tucker](https://github.com/colintucker)[Praxis Interactive](http://www.praxis.net.au)License
-------

[](#license)

[BSD-3-Clause](LICENSE.md) © Praxis Interactive

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~25 days

Recently: every ~31 days

Total

6

Last Release

3145d ago

Major Versions

0.1.2 → 1.0.02017-06-15

### Community

Maintainers

![](https://www.gravatar.com/avatar/f5d47a59cd183aa3f599c2b66dfce7c79c249c2eacb749f0ac8c38c4ca273d14?d=identicon)[PraxisNetAu](/maintainers/PraxisNetAu)

---

Top Contributors

[![colintucker](https://avatars.githubusercontent.com/u/1853705?v=4)](https://github.com/colintucker "colintucker (9 commits)")

---

Tags

countriescountrydropdownfieldsilverstripe-4silverwaresilverstripecountriesfielddropdowncountrysilverware

### Embed Badge

![Health badge](/badges/silverware-countries/health.svg)

```
[![Health](https://phpackages.com/badges/silverware-countries/health.svg)](https://phpackages.com/packages/silverware-countries)
```

###  Alternatives

[silverstripe/tagfield

Tag field for SilverStripe

571.2M45](/packages/silverstripe-tagfield)[kinglozzer/multiselectfield

A sortable multiple select field for managing many-to-many relations

1341.2k2](/packages/kinglozzer-multiselectfield)[dnadesign/silverstripe-advanceddropdowns

DropdownField and GroupedDropdownField that allows the use of data-attributes on each option tag

1717.3k](/packages/dnadesign-silverstripe-advanceddropdowns)[dnadesign/silverstripe-datedropdownselectorfield

Select your date values with Dropdown Fields

138.8k](/packages/dnadesign-silverstripe-datedropdownselectorfield)[burnbright/silverstripe-externalurlfield

Provides SilverStripe with a DBField and FormField for handling external URLs.

109.6k1](/packages/burnbright-silverstripe-externalurlfield)[adrhumphreys/silverstripe-textdropdownfield

A text field combined with a dropdown field.

106.1k](/packages/adrhumphreys-silverstripe-textdropdownfield)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
