I have a php file that I use to print pdf (using FPDF). In this file I have a variable $date and I would like to show this variable $date in the header on each of the pages of my pdf document. That is my variable $date:
$convert_date=strtotime($selected_date);
global $date;
$date=date("d/m/Y",$convert_date);
Ve bu sınıf FPDF olduğunu:
class PDF extends FPDF{
function setDate($dat){
$this->header_date = $dat;
}
function getDate(){
return $this->header_date;
}
function Header(){
$this->SetFont('Arial','B',16);
$this->setDate($date);
$this->Write (10, ' Date: '); //1° Write
$this->Write (10, $this->getDate()); //2° Write NOT WORKING
$this->Ln();
} ...
Sorun ikinci $ this-> baskılar şey yazın olmasıdır.
Ben $this->setDate('abcd'); ararsanız, o ok "abcd" yazdırır kontrol etti.
How can I pass this $date variable in my pdf header function?