Ejemplo n.º 1
0
 /**
  * @param mixed $content
  * @param int|null $code
  * @param array $headers
  */
 public function __construct($content = null, $code = null, $headers = [])
 {
     parent::__construct(null, $code, $headers);
     if ($content) {
         $this->setJsonContent($content);
     }
 }
Ejemplo n.º 2
0
 /**
  * @param ImageAdapter|string $content
  * @return \Phalcon\Http\ResponseInterface|void
  */
 public function setContent($content)
 {
     if ($content instanceof ImageAdapter) {
         $this->setContentType($content->getMime());
         $content = $content->render();
     }
     parent::setContent($content);
 }
Ejemplo n.º 3
0
 /**
  * @param string|Template $content
  * @return \Phalcon\Http\ResponseInterface|void
  */
 public function setContent($content)
 {
     $this->setContentType('application/xml');
     parent::setContent($content);
 }
Ejemplo n.º 4
0
 /**
  * @param $name
  * @param $args
  * @return Response
  */
 public function __call($name, $args)
 {
     return $this->request->isAjax() || $this->request->isJson() ? JsonResponse::methodNotAllowed() : Response::methodNotAllowed();
 }
Ejemplo n.º 5
0
 /**
  * @param string|Template $content
  * @return \Phalcon\Http\ResponseInterface|void
  */
 public function setContent($content)
 {
     $this->setContentType('application/javascript');
     parent::setContent($content);
 }
Ejemplo n.º 6
0
 /**
  * @param string|Template $content
  * @return \Phalcon\Http\ResponseInterface|void
  */
 public function setContent($content)
 {
     $this->setContentType('text/css');
     parent::setContent($content);
 }