コード例 #1
0
 /**
  * Lists all Person models.
  * @return mixed
  */
 public function actionIndex()
 {
     $searchModel = new PersonSearch();
     $queryParams = array_merge(array(), Yii::$app->request->queryParams);
     $queryParams['PersonSearch']['is_student'] = true;
     $dataProvider = $searchModel->search($queryParams);
     return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
 }
コード例 #2
0
ファイル: GuestController.php プロジェクト: mosedu/confprof
 /**
  * Export data
  * @return mixed
  */
 public function actionExport()
 {
     $searchModel = new PersonSearch();
     $dataProvider = $searchModel->search(Yii::$app->request->queryParams, ['prs_type' => Person::PERSON_TYPE_GUEST, 'prs_active' => 1]);
     $sDir = Yii::getAlias('@webroot/assets');
     $sFileName = $sDir . DIRECTORY_SEPARATOR . 'guest-' . date('Y-m-d-H-i-s') . '.xls';
     $this->clearDestinationDir($sDir, 'xls', time() - 300);
     $this->exportToFile($dataProvider, $sFileName);
     Yii::$app->response->sendFile($sFileName);
 }
コード例 #3
0
 /**
  * Lists all Person models.
  * @return mixed
  */
 public function actionIndex()
 {
     $searchModel = new PersonSearch();
     $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
     return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
 }