public function actionCreate() { $model = new Comkarupan(); if ($model->load(Yii::$app->request->post())) { $this->Uploads(false); //$model->picture = $this->uploadSingleFile($model); $model->docs = $this->uploadMultipleFile($model); $model->addtosysdate = new \yii\db\Expression('NOW()'); $model->user_rec = \Yii::$app->user->identity->id; if ($model->save()) { return $this->redirect(['view', 'id' => $model->id, 'cid' => $model->ctype]); } } else { $model->ref = substr(Yii::$app->getSecurity()->generateRandomString(), 10); } return $this->render('create', ['model' => $model]); }