コード例 #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 actionUpdate($id)
 {
     $model = $this->loadModel($id);
     if (isset($_POST['ServiceCategory'])) {
         $model->attributes = $_POST['ServiceCategory'];
         $model->imageFile = CUploadedFile::getInstance($model, 'imageFile');
         if ($model->save()) {
             $model->saveImage();
             OurService::massUpdateDisplayOrder();
             $this->redirect(array('index'));
         }
     }
     $this->render('update', array('model' => $model, 'actions' => $this->listActionsCanAccess));
 }