\CustomCountryDropdownField
A simple extension to dropdown field, pre-configured to list countries.
It will default to the country of the current visitor.
Synopsis
class CustomCountryDropdownField
extends DropdownField
{
- // members
- private static bool $default_to_locale = true;
- private static string $default_country = 'NZ';
- protected array $extraClasses = ;
- // methods
- protected string locale()
- public void __construct()
- public void Field()
Hierarchy
Extends
- DropdownField
Members
private
- $default_country
—
string
The region code to default to if default_to_locale is set to false, or we can't determine a region from a locale - $default_to_locale
—
bool
Should we default the dropdown to the region determined from the user's locale?
protected
- $extraClasses
Methods
protected
- locale() — Get the locale of the Member, or if we're not logged in or don't have a locale, use the default one