----- Original Message ----- From: "Angus Mann" <angusm...@pobox.com>
To: "php-general" <php-general@lists.php.net>
Sent: Monday, April 26, 2010 2:46 PM
Subject: [PHP] FPDF passing values into header and footer?


Hi all. Whilst this question relates to fpdf (www.fpdf.org) I think it really is a PHP question, because it involves passing values into classes and functions.

Here's the problem .. I need to pass a PHP variable like $number into the header of a PDF.
I have extended the FPDF class as follows....

class PDF extends FPDF{
   function Header(){
       $this->SetFont('Arial','BU',12);
       $this->Cell(0,5,'User notes for invoice number '.$number,0,'1','L');
   }
}


I hate it when I ask a question prematurely, because I could have figured it out myself. Getter and Setter functions are the answer.

function setNumber($number){
   $this->number = $number;
}

$pdf->setNumber('12345');




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to