コード例 #1
0
ファイル: Dictionary.php プロジェクト: mademingshiwo/todolist
 public static function getArea($parent_id = 0)
 {
     $select_ret = [];
     $selects = AreaInfoTable::find()->where('parent_id = :parent_id', [':parent_id' => $parent_id])->all();
     foreach ($selects as $select) {
         $select_ret[$select->id] = $select->name;
     }
     return $select_ret;
 }
コード例 #2
0
 public function actionFind()
 {
     $area_id = Yii::$app->request->post('area_id', 0);
     if ($area_id == 0) {
         return;
     }
     $datas = AreaInfoTable::find()->where('parent_id = :parent_id', [':parent_id' => $area_id])->asArray()->all();
     foreach ($datas as $data) {
         echo Html::tag('option', $data['name'], ['value' => $data['id']]);
     }
 }