public function actionIndex() { $model = new StudentElectives('search'); $model->unsetAttributes(); // clear any default values if (isset($_GET['StudentElectives'])) { $model->attributes = $_GET['StudentElectives']; } $this->render('index', array('model' => $model)); }