In my view page, I have called this function
<a href="<?php echo base_url();?>verify/pdf/<?php echo $row>invoice_no;?>" ><button>Generated Pdf</button></a>
My controller
<?php
function pdf($id)
{
$data = [];
$this->load->database();
$this->load->model('useradmin');
$data['dealer'] = $this->useradmin->selectdealer($id);
$data['dealerdes'] = $this->useradmin->selectdealer1($id);
// load the view and saved it into $html variable
$html = $this->load->view('envoice', $data, true);
// this the the PDF filename that user will get to download
$pdfFilePath = "output_pdf_name.pdf";
// load mPDF library
$this->load->library('m_pdf');
// generate the PDF from the given html
$this->m_pdf->pdf->WriteHTML($html);
// download it.
$this->m_pdf->pdf->Output($pdfFilePath, "D");
}
This is not working if I have passed function pdf(); without argument its working but dynamic content does not show in my PDF.
Please suggest how to pass id to my function.