controllers/BooksController.php
/**
     * Updates an existing Book model.
     * If update is successful, the browser will be redirected to the 'view' page.
     * @param integer $id
     * @return mixed
     */
Updates an existing Book model.
If update is successful, the browser will be redirected to the 'view' page.
@param integer $id
@return mixed
Updates an existing Book model . If update is successful the browser will be redirected to the ' view ' page . @param integer $id @return mixed
public function actionUpdate($id)
    {
        $model = $this->findModel($id);
        $returnUrl = $this->checkAfterSaveBookUrl();
        if ($model->load(Yii::$app->request->post())) {
            $model->previewFile = UploadedFile::getInstance($model, 'previewFile');
            if ($model->save()) {
                return $this->redirect($returnUrl);
            }
        }
        return $this->render('update', [
            'model' => $model,
        ]);
    }
public function actionUpdate ( $ id ) { $ model = $ this -> findModel ( $ id ) ; $ returnUrl = $ this -> checkAfterSaveBookUrl ( ) ; if ( $ model -> load ( Yii :: $ app -> request -> post ( ) ) ) { $ model -> previewFile = UploadedFile :: getInstance ( $ model , 'previewFile' ) ; if ( $ model -> save ( ) ) { return $ this -> redirect ( $ returnUrl ) ; } } return $ this -> render ( 'update' , [ 'model' => $ model , ] ) ; }
Updates an existing Book model.
Updates an existing Book model .