/** * Creates a new Lots model. * If creation is successful, the browser will be redirected to the 'view' page. * @return mixed */ public function actionCreate() { $model = new Lots(); $model->auction = Auction::$app->request->get('auction'); $model->lotPreferences = new LotPreference(); if (Lots::model()->saveLot(Yii::$app->request->post())) { return 'Success'; } else { return $this->renderPartial('_form', [ 'model' => $model, ]); } }