public function actionDefault($bid) { $brand = Brands::model()->findByPk($bid); $model = new Addresses('search'); $model->unsetAttributes(); // clear any default values $model->brand_id = $bid; if (isset($_GET['Addresses'])) { $model->attributes = $_GET['Addresses']; } $this->render('admin', array('model' => $model, 'brand' => $brand)); }