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');
    }
}

The problem is, I can't figure out how to pass a value from the rest of the PHP 
script so it can be seen within the function above.

I'm sure the problem is one of the scope of the variable but this sort of thing 
is new to me and I can't figure out the syntax to make it work.

Before anybody suggests something like ...
function Header($number){}
Please recognize that the Header function is called automatically by FPDF and 
not by my code, so unless I totally hack the FPDF class I can't do this easily.

Any suggestions please?

 

Reply via email to