Hello,
I am having a problem with the following.
PHP Code:
include("pdf_micrographx.php"); $mailen = "ja"; include("pdf_micrographx.php");
In pdf_micrographx.php i am declaring a class. No problem.
But now i want to extend that class as follows:
PHP Code:
// Extend the TCPDF class to create custom Header and Footer class MYPDF extends TCPDF { //Page header public function Header() { $this->Cell(30, 10, 'Title', 0, 0, 'C'); } // Page footer public function Footer() { $this->Cell(0, 10, 'Page', 0, 0, 'C'); } } // create new PDF document $pdf = new TCPDF('P', 'mm', 'A4', true, 'UTF-8', false);
But when i do this i get an error that i have already declared my class. Seems logic to me, since i include the file twice. But what i dont understand is why i do not get that error, if i do not extend the class, and simply replace the above with:
PHP Code:
$pdf = new MYPDF('P', 'mm', 'A4', true, 'UTF-8', false);
Any suggestions as to why i only get an error when i extend the class, and how to solve the error?
thanks!
Matt
Last edited by killerwhale65; 02-02-2009 at 09:51 AM..
|