public function actionAGenders() { $Jk = new Jk(); $Views = View::model()->findAll(); if (isset($_POST['Jk'])) { $Jk->attributes = $_POST['Jk']; if ($Jk->save()) { $this->redirect(array('lgenders', 'fitback' => 4)); } } $this->render('agendes', array('Jk' => $Jk, 'Views' => $Views)); }
/** * Returns the data model based on the primary key given in the GET variable. * If the data model is not found, an HTTP exception will be raised. * @param integer $id the ID of the model to be loaded * @return Jk the loaded model * @throws CHttpException */ public function loadModel($id) { $model = Jk::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }