controllers/ProgramasController.php
/**
     * Updates an existing Programas model.
     * If update is successful, the browser will be redirected to the 'view' page.
     * @param integer $id
     * @return mixed
     */
Updates an existing Programas model.
If update is successful, the browser will be redirected to the 'view' page.
@param integer $id
@return mixed
Updates an existing Programas model . If update is successful the browser will be redirected to the ' view ' page . @param integer $id @return mixed
public function actionUpdate($id)
    {
        if (Yii::$app->request->post('_asnew') == '1') {
            $model = new Programas();
        }else{
            $model = $this->findModel($id);
        }
        if ($model->loadAll(Yii::$app->request->post()) && $model->saveAll()) {
            return $this->redirect(['view', 'id' => $model->prg_id]);
        } else {
            return $this->render('update', [
                'model' => $model,
            ]);
        }
    }
public function actionUpdate ( $ id ) { if ( Yii :: $ app -> request -> post ( '_asnew' ) == '1' ) { $ model = new Programas ( ) ; } else { $ model = $ this -> findModel ( $ id ) ; } if ( $ model -> loadAll ( Yii :: $ app -> request -> post ( ) ) && $ model -> saveAll ( ) ) { return $ this -> redirect ( [ 'view' , 'id' => $ model -> prg_id ] ) ; } else { return $ this -> render ( 'update' , [ 'model' => $ model , ] ) ; } }
Updates an existing Programas model.
Updates an existing Programas model .