I am using phalcon framework, and i need to generate pdf file. I was thinking to use mpdf library, i serached online and i didn't find how to use mpdf in phalcon for generating pdf files. Please, I need some example of how can i do this , in easiest way. I worked with mpdf in codeigniter, and here is my function example:
public function createPdf(){
$userId = $this->input->post('bbb');
$this->load->model('osoba');
$this->load->library('pdf');
$rez['rez'] = $this->osoba->getUsers($userId);
$html = $this->load->view('pdf_report', $rez, true);
$pdf = $this->pdf->load();
$pdf->WriteHTML($html, 2);
$br = rand(0,100000);
$ispis = "Pobjeda Rudet-Izvjestaj-".$br;
$pdf->Output($ispis, 'I');
}
I need to achieve this in Phalcon, please I neeed your help. Thanks in advance.