polderknowledge/zend-form-country-select

Country select box for Zend Framework 3

0.2.0 2018-08-21 06:00 UTC

This package is auto-updated.

Last update: 2024-12-12 05:52:51 UTC


README

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.