Put the CountrySelectorWidget.php file under the extensions/ subdirectory of application base directory.
<?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,
));
?>
-
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