/** * 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); $availableProductServices = ProductService::getAvailableService($model->rate_company_service_id); // Uncomment the following line if AJAX validation is needed // $this->performAjaxValidation($model); if (isset($_POST['ServiceDetail'])) { $model->attributes = $_POST['ServiceDetail']; if ($model->save()) { $this->redirect(array('index', 'company_service_id' => $model->rate_company_service_id)); } } $this->render('update', array('model' => $model, 'availableProductServices' => $availableProductServices)); }