global $header_content ;
$header_content = '123123213dd213';
class MYPDF extends TCPDF
{
function __construct( )
{
parent::__construct();
}
//Page header
public function Header() {
global $header_content ;
// Set font
$this->SetFont('helvetica', '', 10);
$this->Cell(0, 15, $header_content , 0, false, 'L', 0, '', 0, false, 'M', 'M');
}
}
Much thanks to Merianos Nikos's answer at How to make variable global across entire class
This works just fine. But is it the right way to do it?