/** * Returns the array of possible user status values. * * @return array */ public function getCountriesList() { $modelPlaceCountry = PlaceCountry::find()->asArray()->all(); $countriesArray = ArrayHelper::map($modelPlaceCountry, 'iso2', function ($modelPlaceCountry, $defaultValue) { return Yii::t('app', $modelPlaceCountry['short_name']) . ' +' . $modelPlaceCountry['calling_code']; }); return $countriesArray; }
/** * Returns the array of possible user status values. * * @return array */ public function getCountriesList() { $modelPlaceCountry = PlaceCountry::find()->asArray()->all(); $countriesArray = ArrayHelper::map($modelPlaceCountry, 'id', function ($modelPlaceCountry) { return Yii::t('countries', $modelPlaceCountry['short_name']) . ' +' . str_replace(['\\'], '', $modelPlaceCountry['calling_code']); }); return $countriesArray; }