output() public method

Output the file object directly.
public output ( boolean $download = false ) : File
$download boolean
return File
Example #1
0
 /**
  * Output the PDF directly to the browser.
  *
  * @param  boolean $download
  * @return void
  */
 public function output($download = false)
 {
     // Format and finalize the PDF.
     $this->finalize();
     parent::output($download);
 }
Example #2
0
 /**
  * Method to output the SVG image.
  *
  * @param  boolean $download
  * @return void
  */
 public function output($download = false)
 {
     $dom = new \DOMDocument('1.0');
     $dom->preserveWhiteSpace = false;
     $dom->formatOutput = true;
     $dom->loadXML($this->resource->asXML());
     $this->output = $dom->saveXML();
     parent::output($download);
 }
Example #3
0
 /**
  * Output the code object directly.
  *
  * @param  boolean $download
  * @return \Pop\Code\Generator
  */
 public function output($download = false)
 {
     $this->render(true);
     parent::output($download);
 }
Example #4
0
 public function testOutput()
 {
     if (file_exists(__DIR__ . '/../tmp/file.txt')) {
         unlink(__DIR__ . '/../tmp/file.txt');
     }
     $f = new File(__DIR__ . '/../tmp/file.txt');
     $f->write('123');
     $this->setExpectedException('Pop\\Http\\Exception');
     $f->output();
 }