polderknowledge / zend-form-country-select
Country select box for Zend Framework 3
0.2.0
2018-08-21 06:00 UTC
Requires
- php: >= 7.0
- league/iso3166: ^2.1
- lstrojny/functional-php: ^1.8
- zendframework/zend-form: ^2.12
Requires (Dev)
- phpunit/phpunit: ^7
This package is auto-updated.
Last update: 2024-10-12 05:21:14 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.