class PDF extends FPDF
{
var $cf;
function change( $cf) {
$this->cf = $cf;
}
// Page header
function Header()
{
$this->Cell(20,10,'CF / PI:'. $this->cf, 0, 1,'L');
// Line break
$this->Ln(2);
}
// Page footer
function Footer()
{
// Position at 1.5 cm from bottom
$this->SetY(-15);
// Arial italic 8
$this->SetFont('Arial','I',8);
// Page number
$this->Cell(0,10,'Page '.$this->PageNo().'/{nb}',0,0,'C');
}
}
$pdf->change($row['cf']);
使用这段代码,我可以从第二页看到标题。第一页没有显示任何东西。
我想在所有页面的标题中看到我在 php 文件中的这个变量。
我该怎么办?