protected function imageResponse(\Phalcon\Image\Adapter $image) { $this->view->disable(); $response = new \Phalcon\Http\Response(); $response->setContentType($image->getMime()); $response->setContent($image->render()); return $response; }
/** * @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); }