RIRedinPA Posted October 7, 2009 Share Posted October 7, 2009 What am I doing wrong here? <?php require("/Volumes/ARTARCHIVE/************/fpdi/fpdi.php"); class PDF extends FPDF { function BasicTable($headerarray,$textarray) { //Header foreach($headerarray as $col) { $this->Cell(40,7,$col,1); $this->Ln(); } //Data foreach($textarray as $row) { foreach($row as $col) { $this->Cell(40,6,$col,1); $this->Ln(); } } } //end function }//end class $headerarray = array("Field 1", "Field 2", "Field 3", "Field 4"); $textarray = array(array("row1item1", "row1item2" , "row1item3", "row1item4"), array("row2item1", "row2item2" , "row2item3", "row2item4"), array("row3item1", "row3item2" , "row3item3", "row3item4")); $pdf=new FPDF(); $pdf->SetFont('Arial','',14); $pdf->AddPage(); $pdf->BasicTable($headerarray,$textarray); $pdf->Output(); ?> Error: Call to undefined method: fpdf->basictable() Quote Link to comment Share on other sites More sharing options...
ILMV Posted October 7, 2009 Share Posted October 7, 2009 Shouldn't it be: $pdf=new PDF(); Considering PDF extends FPDF? Quote Link to comment Share on other sites More sharing options...
RIRedinPA Posted October 7, 2009 Author Share Posted October 7, 2009 Shouldn't it be: $pdf=new PDF(); Considering PDF extends FPDF? <cringe>doh</cringe> Yup, thanks... : D Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.