public function actionList() { if (isset($_POST['depdrop_parents'])) { if ($parents = $_POST['depdrop_parents']) { $out[-1] = Yii::t('app', 'New object'); $out += Object::getList($parents[0]); foreach ($out as $key => $value) { $result[] = ['id' => $key, 'name' => $value]; } print Json::encode(['output' => @$result, 'selected' => '']); return; } } }