Created
February 27, 2009 13:44
-
-
Save tonio/71477 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Returns PDF file whith appropriate headers | |
* | |
* @param string $content The file content | |
* | |
* @return sfView::NONE | |
*/ | |
public function renderPDF($content) | |
{ | |
$r = $this->getResponse(); | |
$r->clearHttpHeaders(); | |
$r->setContentType('application/pdf'); | |
$r->setHttpHeader('Content-Disposition', 'inline; filename="print.pdf"'); | |
return $this->renderText($content); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment