/** * Manages all models. */ public function actionAdmin() { // page size drop down changed if (isset($_GET['pageSize'])) { Yii::app()->user->setState('pageSize', (int) $_GET['pageSize']); unset($_GET['pageSize']); // would interfere with pager and repetitive page size change } $model = new Cartridge('search'); $model->unsetAttributes(); // clear any default values if (isset($_GET['Cartridge'])) { $model->attributes = $_GET['Cartridge']; } if ($this->isExportRequest()) { $this->exportCSV($model->search(), array('location.name', 'commodity.name', 'category_id', 'category.name', 'user.name', 'status.status', 'manufacturer.name', 'consumabletype.name', 'managementtype.name', 'model', 'threshold', 'imageFileName', 'documentFileName', 'enable_financial', 'available_on_loan', 'semi_consumable')); } $this->render('admin', array('model' => $model)); }