public function actionCreate() { $form = new CreateCurrencyForm(); $form->load(Yii::$app->request->post()); $form->setUser($this->_user); if ($form->save()) { return ['status' => true, 'data' => $form->getCurrency()]; } return ['status' => false, 'error' => ApiActiveRecord::ERROR_VALIDATION, 'error_code' => ApiActiveRecord::ERROR_VALIDATION, 'data' => $form->errors]; }