Пример #1
0
 /**
  * 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
  */
 public function actionUbah($id)
 {
     $model = $this->loadModel($id);
     $child = new AuthItemChild('search');
     $child->unsetAttributes();
     $child->setAttribute('parent', '=' . $id);
     // Uncomment the following line if AJAX validation is needed
     // $this->performAjaxValidation($model);
     if (isset($_POST['AuthItem'])) {
         $model->attributes = $_POST['AuthItem'];
         $model->save();
     }
     $this->render('ubah', array('model' => $model, 'child' => $child, 'authItem' => $this->_listAuthItem($id)));
 }