controllers/BooksController.php
/**
     * Creates a new Book model.
     * If creation is successful, the browser will be redirected to the 'view' page.
     * @return mixed
     */
Creates a new Book model.
If creation is successful, the browser will be redirected to the 'view' page.
@return mixed
Creates a new Book model . If creation is successful the browser will be redirected to the ' view ' page . @return mixed
public function actionCreate()
    {
        $model = new Book();
        $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('create', [
            'model' => $model,
        ]);
    }
public function actionCreate ( ) { $ model = new Book ( ) ; $ 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 ( 'create' , [ 'model' => $ model , ] ) ; }
Creates a new Book model.
Creates a new Book model .