public function actionExport() { $model = new MenuType(); $model->unsetAttributes(); // clear any default values if (isset($_POST['MenuType'])) { $model->attributes = $_POST['MenuType']; } $exportType = $_POST['fileType']; $this->widget('ext.heart.export.EHeartExport', array('title' => 'List of MenuType', 'dataProvider' => $model->search(), 'filter' => $model, 'grid_mode' => 'export', 'exportType' => $exportType, 'columns' => array('menuType_id', 'name'))); }
public function actionTrash($id = NULL) { $model = new MenuType('search'); $model->unsetAttributes(); // clear any default values if (isset($_GET['MenuType'])) { $model->attributes = $_GET['MenuType']; } if (isset($id)) { $model = $this->loadModel($id); $model->status = 1; if ($model->save(true, array('status'))) { Yii::app()->user->setFlash('success', Yii::t('menutype', 'Menutype was re-activate.')); } else { Yii::app()->user->setFlash('error', Yii::t('menutype', 'Menutype cannot re-activate. Please try it later.')); } $this->redirect(array('/' . backend . '/menutype/trash')); } $this->render(strtolower($this->action->Id), array('model' => $model)); }