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