General
require('fpdf.php');
$pdf=new FPDF();
$pdf->AddPage();
$pdf->SetFont('Arial','B',16);
$pdf->Cell(40,10,'Hello World!');
$pdf->Output();
I want to separate it two class (base and child(child do with data) )
base class (present the template of output )
require('fpdf.php');
class base{
//TODO
function def(){
$pdf=new FPDF();
$pdf->AddPage();
// the page header DO IN HERE
// ->DO IN Derived Class(leave derived to do with data )
// the page footer DO IN HERE
$pdf->Output();
}
}
child class (manipulate the data )
class child extends base{
//TODO
function def(){
$pdf->Cell(40,10,'Hello World!');
}
}
when call will use the child class for out the pdf file
$obj_pdf = new child();
$obj_pdf->def();
How should I implement it? or it is not possible to this?