Exemplo n.º 1
0
 public function getPosseStudent($param, $app)
 {
     # csv export handler; determine $this->exportReq
     $param = parse::parseParam($param, $this);
     $this->posseStudentResult = self::$studentModel->getPosseStudent($param, $this->exportReq);
     if ($this->exportReq) {
         # set headers/create csv file
         export::exportData($this->posseStudentResult);
     } else {
         $decodeResult = json_decode($this->posseStudentResult, true);
         $this->posseStudentResultTotal = count($decodeResult['DATA']);
     }
     $app->response->headers->set('X-Total-Count', $this->posseStudentResultTotal);
     $app->response->headers->set('Content-Type', 'application/vnd.vassar+json');
     $app->response->setBody($this->posseStudentResult);
 }
 public function getPosseStudent($param, $app)
 {
     # csv export handler; determine $this->exportReq
     $param = parse::parseParam($param, $this);
     $this->posseStudentResult = self::$studentModel->getPosseStudent($param, $this->exportReq);
     # X-Total-Count header
     $decodeResult = json_decode($this->posseStudentResult, true);
     $this->posseStudentResultTotal = count($decodeResult['DATA']);
     if ($this->exportReq) {
         # set headers/create csv file
         export::exportData($this->posseStudentResult);
     }
     $app->response->headers->set('X-Total-Count', $this->posseStudentResultTotal);
     if ($_SESSION['print_pretty'] === 'true') {
         $app->response->setBody("<pre>" . $this->posseStudentResult . "</pre>");
     } else {
         $app->response->setBody($this->posseStudentResult);
     }
 }