/** * Render a Pdf view. * * @param string $view The view being rendered. * @param string $layout The layout being rendered. * @return string The rendered view. */ public function render($view = null, $layout = null) { $content = parent::render($view, $layout); if ($this->response->type() === 'text/html') { return $content; } if ($this->renderer() === null) { $this->response->type('html'); return $content; } if (isset($this->pdfConfig['download']) && $this->pdfConfig['download'] === true) { $this->response->download($this->getFilename()); } $this->Blocks->set('content', $this->renderer()->output($content)); return $this->Blocks->get('content'); }