View_PDF::render PHP Method

render() public method

public render ( $file = NULL )
    public function render($file = NULL)
    {
        // Render the HTML normally
        $html = parent::render($file);
        // Turn off strict errors, DOMPDF is stupid like that
        $ER = error_reporting(~E_STRICT);
        // Render the HTML to a PDF
        $pdf = new DOMPDF();
        $pdf->load_html($html);
        $pdf->render();
        // Restore error reporting settings
        error_reporting($ER);
        return $pdf->output();
    }

Usage Example

示例#1
0
 public function render($name = NULL, $dest = NULL)
 {
     // Create Pages
     $this->_render_expenses();
     $this->_render_payments();
     $this->_render_taxpayments();
     return parent::render($name, $dest);
 }