require('fpdf.php');
$pdf=new FPDF();
$pdf->AddPage();
$pdf->SetFont('Arial','B',16);
$pdf->Cell(40,10,'Hello World!');
$pdf->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();
}
}
子類(操縱數據)
class child extends base{
//TODO
function def(){
$pdf->Cell(40,10,'Hello World!');
}
}
當呼叫將使用兒童班出pdf file
$obj_pdf = new child();
$obj_pdf->def();
我應該如何實現它?或者這是不可能的?
FPDF已經可以幫助你方便頁眉/頁腳代。你看過這個教程嗎? http://www.fpdf.org/en/tutorial/tuto2.htm – gnud 2011-05-11 14:13:34
+1 @gnud給你 – kn3l 2011-05-11 15:38:50