Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Country selector widget for Yii
PHP
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
CountrySelectorWidget.php
README.md Attributes description updated

README.md

Installation

Put the CountrySelectorWidget.php file under the extensions/ subdirectory of application base directory.

Usage

<?php

$this->widget('application.extensions.countrySelectorWidget', array(
    'value' => $model->country,
    'name' => Chtml::activeName($model, 'country'),
    'id' => Chtml::activeId($model, 'country'),
    'useCountryCode' => false,
    'defaultValue' => 'Japan',
    'firstEmpty' => false,
));

?>

Attributes

  • useCountryCode - determines whether country code (US, GB) or country full name (United States, United Kingdom) will be used for select value

  • firstEmpty - determines whether an empty option should be inserted on top of select. Text can be specified using firstText parameter.

  • firstText - specifies text for optional empty first option, by default (please select a country)

  • defaultValue - default pre-selected option for case value is empty

Something went wrong with that request. Please try again.