Skip to content

polderknowledge/zend-form-country-select

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ZF3 Country dropdown

Country dropdown for zend-form (Zend Framework 3).

Works with 2-letter ISO 3166 codes

Options are displayed in the current locale.

Installation

$ composer require polderknowledge/country-dropdown

Usage

in Form::init():

$this->add([
    'type' => CountrySelect::class,
    'name' => 'country',
    'options' => [
        // optional countries to display first in the dropdown above a separator
        'top_country_codes' => ['NL', 'ES'],
    ],
]);

Rendering can be done in the same way as a normal select element.