Exemplo n.º 1
0
 /**
  * Send the response to the device
  */
 public function send($content = null, $type = null)
 {
     if (!is_null($content)) {
         $this->setContents(is_array($content) ? $content : array($content));
     }
     if (!is_null($type)) {
         $this->setContentType($type);
     }
     return parent::send();
 }
Exemplo n.º 2
0
 /**
  * @param null|string $content
  * @param null|string $type
  * @return void
  */
 public function send($content = null, $type = null)
 {
     if (!empty($content)) {
         self::addContent(null, $content);
     }
     if (!empty($type)) {
         parent::setContentType($type);
     }
     parent::send();
 }
Exemplo n.º 3
0
 /**
  * Prepare the content of the response before to send it to client
  *
  * @param \Library\HttpFundamental\Response $response
  * @return void
  */
 public function prepareResponse(Response $response)
 {
     $cto = $this->getContentTypeObject();
     if (!empty($cto)) {
         $ctt_type = $cto->getContentType();
     } else {
         $ctt_type = $this->getContentType();
     }
     $response->setContentType($ctt_type);
 }