Example #1
0
 /**
  * Updates a particular model.
  *
  * @param integer $id the ID of the model to be updated
  *
  * @throws CHttpException
  */
 public function actionUpdate($id)
 {
     $model = $this->loadModel($id);
     $this->breadcrumbs = Page::getBreadcrumbs($model->id, 'Редактирование');
     if (isset($_POST['Page'])) {
         $model->attributes = $_POST['Page'];
         if ($model->save()) {
             $this->redirect(array('index', 'parentId' => $model->parent_id));
         }
     }
     $this->render('form', array('model' => $model));
 }