Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if ($model->load(Yii::$app->request->post()) && $model->validate()) {
- $model->document = UploadedFile::getInstance($model, 'document');
- if ($model->upload() !== false) {
- $model->save();
- }
- return $this->redirect(['view', 'id' => $model->id]);
- } else {
- return $this->render('create', [
- 'model' => $model,
- ]);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement