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');
}