public function actionAdd() { $subspecialtyId = $this->request->getParam('subspecialty_id'); $leafletId = $this->request->getParam('leaflet_id'); if (!Yii::app()->request->isAjaxRequest) { $this->render('errorpage', array('errormessage' => 'notajaxcall')); } else { if (!is_numeric($subspecialtyId) || !is_numeric($leafletId)) { echo 'error'; } else { $newLFS = new OphTrConsent_Leaflet_Subspecialty(); $newLFS->subspecialty_id = $subspecialtyId; $newLFS->leaflet_id = $leafletId; if ($newLFS->save()) { echo 'success'; } else { echo 'error'; } } } }
public function actionAdd() { $subspecialtyId = $this->request->getParam("subspecialty_id"); $leafletId = $this->request->getParam("leaflet_id"); if (!Yii::app()->request->isAjaxRequest) { $this->render("errorpage", array("errormessage" => "notajaxcall")); } else { if (!is_numeric($subspecialtyId) || !is_numeric($leafletId)) { echo "error"; } else { $newLFS = new OphTrConsent_Leaflet_Subspecialty(); $newLFS->subspecialty_id = $subspecialtyId; $newLFS->leaflet_id = $leafletId; if ($newLFS->save()) { echo "success"; } else { echo "error"; } } } }