public function actionIndex() { $model = new Coupon('search'); $model->unsetAttributes(); // clear any default values if (isset($_GET['Coupon'])) { $model->attributes = $_GET['Coupon']; } $this->render('index', ['model' => $model]); }
public function actionIndex() { $model = new Coupon('search'); $attributes = Yii::app()->getRequest()->getQuery('Coupon'); $model->unsetAttributes(); if ($attributes) { $model->attributes = $attributes; } $this->render('index', ['model' => $model]); }
public function actionAdmin() { IsAuth::Admin(); $model = new Coupon('search'); $model->unsetAttributes(); // clear any default values if (isset($_GET['Coupon'])) { $model->attributes = $_GET['Coupon']; } $this->render('admin', array('model' => $model)); }