dynamic / silverstripe-country-dropdown-field
A simple country dropdown field for SilverStripe forms
Package info
github.com/dynamic/silverstripe-country-dropdown-field
Type:silverstripe-vendormodule
pkg:composer/dynamic/silverstripe-country-dropdown-field
Fund package maintenance!
Requires
- php: ^8.1
- silverstripe/recipe-core: ^6
Requires (Dev)
This package is auto-updated.
Last update: 2026-06-29 22:39:02 UTC
README
A simple country dropdown field for SilverStripe forms.
Requirements
- PHP: ^8.3
- silverstripe/recipe-core: ^6
Installation
composer require dynamic/silverstripe-country-dropdown-field
Usage
CountryDropdownField extends SilverStripe's DropdownField and populates its source with a full list of countries drawn from SilverStripe's IntlLocales service. Use it anywhere you would use a standard form field:
use Dynamic\CountryDropdownField\Form\CountryDropdownField; $fields->addFieldToTab( 'Root.Main', CountryDropdownField::create('Country', 'Country') );
You can also supply a custom country list by passing a source array as the third argument, just like a standard DropdownField.
Features
- Country Dropdown: Pre-configured dropdown field with all countries
- Intl Integration: Uses SilverStripe's
IntlLocalesfor standardized country data - Customizable Source: Optional custom country list support
- Form Field Extension: Extends SilverStripe's
DropdownFieldfor seamless integration
Maintainers
Bugtracker
Bugs are tracked in the issues section of this repository. Before submitting an issue please read over existing issues to ensure yours is unique.
If the issue does look like a new bug:
- Create a new issue
- Describe the steps required to reproduce your issue, and the expected outcome. Unit tests, screenshots and screencasts can help here.
- Describe your environment as detailed as possible: SilverStripe version, Browser, PHP version, Operating System, any installed SilverStripe modules.
Please report security issues to the module maintainers directly. Please don't file security issues in the bugtracker.
Development and contribution
If you would like to make contributions to the module please ensure you raise a pull request and discuss with the module maintainers.
License
See License