Ejemplo n.º 1
0
 public function getCountry()
 {
     return $this->hasOne(Countries::className(), ['country_id' => 'country_id']);
 }
Ejemplo n.º 2
0
 public function actionCountries()
 {
     $countries = Countries::find()->all();
     $result = [];
     if ($countries) {
         /** @var Countries $country */
         foreach ($countries as $country) {
             $result[] = ArrayHelper::toArray($country);
         }
     }
     return json_encode($result);
 }