public function render($action = null, $layout = null) {
		$this->viewPath .= DS . 'Pdf';

		$content = parent::render($action, false);
		if ($this->response->type() == 'text/html') {
			return $content;
		}

		$content = $this->tcpdf->Output('', 'S');
		$this->Blocks->set('content', $content);
		$fileName = $this->getFileName();
		$fileName .= '.pdf';
		$this->response->download($fileName);

		return $this->Blocks->get('content');
	}
public function render($action = null, $layout = null) {
		$this->viewPath .= DS . 'Pdf';

		$content = parent::render($action, false);
		if ($this->response->type() == 'text/html') {
			return $content;
		}

		$content = $this->tcpdf->Output('', 'S');
		$this->Blocks->set('content', $content);
		$fileName = $this->getFileName();
		$fileName .= '.pdf';
		$this->response->download($fileName);

		return $this->Blocks->get('content');
	}
public function render ( $ action = null , $ layout = null ) { $ this -> viewPath .= DS . 'Pdf' ; $ content = parent :: render ( $ action , false ) ; if ( $ this -> response -> type ( ) == 'text/html' ) { return $ content ; } $ content = $ this -> tcpdf -> Output ( '' , 'S' ) ; $ this -> Blocks -> set ( 'content' , $ content ) ; $ fileName = $ this -> getFileName ( ) ; $ fileName .= '.pdf' ; $ this -> response -> download ( $ fileName ) ; return $ this -> Blocks -> get ( 'content' ) ; }
Renders view for given view file and layout.

@param string $action Name of view file to use
@param string $layout Layout to use.
@return string|null Rendered content or null if content already rendered and returned earlier.
@triggers View.beforeRender $this, array($viewFileName)
@triggers View.afterRender $this, array($viewFileName)
@throws CakeException If there is an error in the view.
Renders view for given view file and layout .