public static function getOptions() { $model = Farmer::model()->findAll(); $arr = array(); foreach ($model as $r) { $arr[$r->farmer_id] = $r->farmer_name; } return $arr; }
function actionFarmerDelete($id) { $this->checkLogin(); Farmer::model()->deleteByPk((int) $id); $this->redirect(array('FarmerIndex')); }