public function actionUpdate($id)
{
$model = $this->findModel($id);
if ($model->load(Yii::$app->request->post()) && $model->validate()) {
$model->save();
return $this->redirect(['view', 'id' => $model->id]);
} else {
return $this->render('update', ['model' => $model]);
}
}