Ejemplo n.º 1
0
 public static function getDropDown()
 {
     $items = GeoCountry::find()->asArray()->all();
     $data = [];
     foreach ($items as $i) {
         $data[] = ['id' => $i['id'], 'name' => html_entity_decode($i['name'], ENT_COMPAT, 'UTF-8')];
     }
     return $data;
 }
Ejemplo n.º 2
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getCountry()
 {
     return $this->hasOne(GeoCountry::className(), ['id' => 'country_id']);
 }
Ejemplo n.º 3
0
 public function run()
 {
     return Html::dropDownList($this->attribute, null, ArrayHelper::map(GeoCountry::getDropDown(), 'id', 'name'));
 }