How to call UMUM class in CI4? |
Hello everyone, I need suggestions for creating a report using FPDF with CI4.
Here is my controller: <?php namespace App\Controllers; use App\ThirdParty\FPDF; public function laporan() { $pdf = new UMUM('P','mm','Legal'); $pdf->SetMargins(5, 7, 5); $pdf->SetAutoPageBreak(true, 20); $pdf->AliasNbPages('{pages}'); $pdf->AddPage(); $this->response->setHeader('Content-Type', 'application/pdf'); } The issue I'm facing is how to call the UMUM class in CI4. I had tried it in CI3 and it worked, but in CI4, it doesn't seem to work.
07-05-2023, 08:34 AM
(This post was last modified: 07-05-2023, 08:40 AM by JustJohnQ. Edit Reason: add parameters for page size )
My fpdf (version 1.85) folder is in App\ThirdParty.
I added the following to autoload.php in config: PHP Code: public $classmap = [ My test method looks like this: PHP Code: public function fpdfTest() A PDF is created and automatically saved/opened (depending on browser settings) |
Welcome Guest, Not a member yet? Register Sign In |