/** * Creates a new File model. * If creation is successful, the browser will be redirected to the 'view' page. * @return mixed */ public function actionCreate() { $model = new File(); $model->time = date("Y-m-d H:i:s"); $model->isdel = 0; $post = Yii::$app->request->post(); if (isset($post['File']['tags'])) { if (is_array($post['File']['tags'])) { $post['File']['tags'] = implode(",", $post['File']['tags']); } } if ($model->load($post) && $model->save()) { return $this->redirect(['view', 'id' => $model->id]); } else { return $this->render('create', ['model' => $model]); } }