示例#1
0
 /**
  * {@inheritdoc}
  */
 public function prepare(Response $response, $buffer = null)
 {
     if ($this->headers) {
         $response->header('Content-Type', $this->contentType);
         if ($this->asAttachment) {
             $response->header('Content-Disposition', 'attachment; filename="' . $this->name . '"');
         }
         if ($this->contentLength) {
             $response->header('Content-Length', $this->contentLength);
         }
     }
 }
示例#2
0
文件: Json.php 项目: minchal/vero
 /**
  * {@inheritdoc}
  */
 public function prepare(Response $response, $buffer = null)
 {
     $response->header('Content-Type', 'application/json; charset=UTF-8');
     $this->encoded = json_encode($this->data);
 }
示例#3
0
文件: CSV.php 项目: minchal/vero
 /**
  * {@inheritdoc}
  */
 public function prepare(Response $response, $buffer = null)
 {
     $file = $this->fileName ? $this->fileName : date('Y-m-d');
     $response->header('Content-Type', 'text/csv; charset=' . $this->charset);
     $response->header('Content-disposition', 'attachment; filename=' . $file . '.csv');
     $response->header('Pragma', 'no-cache');
 }
示例#4
0
文件: Simple.php 项目: minchal/vero
 /**
  * {@inheritdoc}
  */
 public function prepare(Response $response, $buffer = null)
 {
     $response->header('Content-Type', 'text/html; charset=UTF-8');
     $this->set('debug', $buffer);
 }
示例#5
0
文件: Twig.php 项目: minchal/vero
 /**
  * {@inheritdoc}
  */
 public function prepare(Response $response, $buffer = null)
 {
     $response->header('Content-Type', $this->format . '; charset=UTF-8');
     $this->set('signature', $this->getSignatureKey());
     $this->set('buffer', $buffer);
     $this->compiled = $this->render();
 }