Updates a particular model.
If update is successful, the browser will be redirected to the 'view' page.
@param integer $id the ID of the model to be updated
347738
public function actionFeedback() 
	{
		$model=new SupportFeedbacks;

		// Uncomment the following line if AJAX validation is needed
		$this->performAjaxValidation($model);

		if(isset($_POST['SupportFeedbacks'])) {
			$model->attributes=$_POST['SupportFeedbacks'];

			$jsonError = CActiveForm::validate($model);
			if(strlen($jsonError) > 2) {
				echo $jsonError;
				
			} else {
				if(Yii::app()->getRequest()->getParam('enablesave') == 1) {
					if($model->save()) {
						echo CJSON::encode(array (
							'type' => 'contact',
							'msg' => Yii::t('phrase', 'Your email was sent!'),
						));
					} else
						print_r($model->getErrors());
				}
			}
			Yii::app()->end();
			
		} else
			$this->redirect(Yii::app()->createUrl('site/index'));
	}
1283825
public function actionEdit(int $id): void
	{
		$this->page = $this->orm->pages->getById($id);
		if (!$this->page) {
			$this->error();
		}

		$gallery = $this['gallery'];
		$gallery->setStorage($this->orm->pagesGalleries);
		$gallery->setForeignKey('page', $this->page->id);
		$gallery->setNamespace('page/' . $this->page->url);
	}
1168464
public function actionView ($id)
		{
			$page = Page::find()->where([ 'id' => $id ])->orWhere([ 'guid' => $id ])->one();
			if ($page === null)
			{
				Yii::$app->notification->errorToSession(Yii::tr('Given page does not exist.', [], 'page'));
				$this->redirect(Url::toRoute([ '/page/index' ]));
			}
			$this->setTitle(Yii::tr('View page', [], 'page'));
			$this->data('page', $page);
			$this->data('useMenu', $this->module->useMenu);
			$this->_tpl = '@pageViews/view';
		}
1210014
public function actionUpdate($id)
    {
        $model = $this->findModel($id);
        if ($model->load(Yii::$app->request->post())) {
            if (Request::isAjax()) {
                Yii::$app->getResponse()->format = Response::FORMAT_JSON;
                return ActiveForm::validate($model);
            } elseif ($model->save()) {
                return $this->flash('更新成功', 'success');
            }
        }
        return $this->render('update', [
            'model' => $model,
        ]);
    }
1071943
protected function __apiUpdate(string $id)
    {
        $record = Galleries::findOrFail($id);

        $data = $this->getInputData();

        $record->update(array_get($data, 'record'));
        $record->updateTranslations(array_get($data, 'translations'));
        $record->images()->sync(array_get($data, 'images'));


        return $this->apiShow($record->id);
    }
1229497
public function actionEdit(int $id): void
	{
		$this->content = $this->orm->content->getById($id);
		if (!$this->content) {
			$this->error();
		}
	}
296994
public function update($id, $model)
    {
        // arguments for private method
        $args = func_get_args();

        // proxy call
        $result = $this->proxy('_update', $args);

        // if($this->shouldUseCache())
        // {
        // 	// Cache::put($this->type . ':' . $result->id, $result, $this->cacheDuration);
        // 	Cache::forget($this->type);
        // }

        return $result;
    }
42978
public function actionUpdate($id)
    {
        $user = $this->findModel($id);
        $model = new MultiModel([
            'models' => [
                'user' => $user,
                'profile' => $user->profile,
            ],
        ]);
        $model->getModel('user')->setScenario('backend');

        if ($model->load(Yii::$app->request->post()) && $model->save()) {
            switch (Yii::$app->request->post('redirect')) {
                case 'exit':
                    return $this->redirect(['index']);
                case 'new':
                    return $this->redirect(['create']);
                default:
                    return $this->redirect(['view', 'id' => $model->getModel('user')->id]);
            }
        } else {
            return $this->render('update', [
                'model' => $model,
                'roles' => ArrayHelper::map(Yii::$app->authManager->getRoles(), 'name', 'description'),
            ]);
        }
    }
534066
public function actionView($id)
    {
        $model = $this->findModel($id);
        $model->updateCounters(['views' => 1]);
        return $this->render($model->view, [
            'model' => $model,
        ]);
    }
1181464
public function update(Request $request, $id)
    {
        $entry = $this->entriesRepository->getById($id, $this->resource);
        $this->validate($request, $this->validationRules($this->resource, $entry));

        $this->entriesRepository->update($id, $request, $this->resource);

        return redirect()->back()->with('success', 'Updated');
    }
568600
public function actionUpdate($id)
    {
        $emailTemplate = $this->loadModel($id);

        if (isset($_POST['EmailTemplate'])) {
            $emailTemplate->attributes = $_POST['EmailTemplate'];
            if ($emailTemplate->save()) {
                $this->redirect(array('template/view', 'id' => $emailTemplate->id));
            }
        }

        $this->render('update', array(
            'emailTemplate' => $emailTemplate,
        ));
    }
1373954
public function updateIDValue(&$id)
    {
        $owner = $this->owner;
        if ($owner->Title) {
            $id = Convert::raw2url($owner->Title);
        }
    }
776611
public function actionUpdate($id)
    {
        if (request()->post('_asnew') == '1') {
            $model = new Comment();
        }else{
            $model = $this->findModel($id);
        }

        if ($model->loadAll(request()->post())) {
            if ($model->saveAll()) {
                set_flash_has_been_saved();
                return $this->redirect(['update', 'id' => $model->id]);
            } else {
                set_flash_has_not_been_saved();
            }
        }

        return $this->render('update', [
            'model' => $model,
        ]);

    }
652146
public function update($id = null) {
        if($id)
            $array = KernelDB::update($this, $this->tuples, static::$model, $id);
        else
            $array = KernelDB::update($this, $this->tuples, static::$model, kernelHttp::request()->getRequiredParameter());

        self::updateThis($this, $array);
    }
212931
public function actionClick($id) 
	{
		$model=$this->loadModel($id);
		if($id == null || $model == null)
			$this->redirect(Yii::app()->createUrl('site/index'));
		else {
			BannerClicks::insertClick($model->banner_id);
			$this->redirect($model->url);
		}
	}
476140
public function actionUpdate($id)
    {
        $model = $this->findModel($id);
        if (!empty($this->module->params['pageSizeAdmin'])) {
            $model->pageSize = intval($this->module->params['pageSizeAdmin']);
        }
        $post = Yii::$app->request->post();
        if ($model->load($post) && $model->save()) {
            return $this->redirect(['index', 'page' => $model->page, 'id' => $model->id]);
        } else {
            $rolesModels = [];
            if ($this->showRoles && !$model->isNewRecord) {
                $authItemModel = $this->module->model('AuthItem');
                $allRoles = $authItemModel::find()->where(['like', 'name', 'role'])->all();
                foreach ($allRoles as $role) {
                    $data = [
                        'item_name' => $role->name,
                        'user_id'   => $model->id,
                    ];
                    
                    $authAssignmentModel = $this->module->model('AuthAssignment');
                    $next = $authAssignmentModel::find()->where($data)->one();
                    if (empty($next)) {
                        $data['value'] = false;
                        $next = $this->module->model('AuthAssignment', [$data]);
                    } else {
                        $next->value = true;
                    }
                    $rolesModels[] = $next;
                }
            }
            return $this->render('update', [
                'model' => $model,
                'rolesModels' => $rolesModels,
            ]);
        }
    }
651719
public function actionUpdate($id)
    {
        $model = $this->findModel($id);
        $model->scenario = 'update';

        if ($model->load(\Yii::$app->request->post()) && $model->save()) {
            if(\Yii::$app->request->get('returnUrl')){
                $back = urldecode(\Yii::$app->request->get('returnUrl'));
                return $this->redirect($back);
            }

            \Yii::$app->getSession()->setFlash('block.success', \Yii::t('block', 'Block has been updated'));
            return $this->refresh();
        }

        return $this->render('update', [
            'model' => $model
        ]);
    }