Advertisement
Guest User

Untitled

a guest
Jun 29th, 2016
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. if ($model->load(Yii::$app->request->post()) && $model->validate()) {
  2.  
  3. $model->document = UploadedFile::getInstance($model, 'document');
  4. if ($model->upload() !== false) {
  5. $model->save();
  6. }
  7.  
  8. return $this->redirect(['view', 'id' => $model->id]);
  9. } else {
  10. return $this->render('create', [
  11. 'model' => $model,
  12. ]);
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement