codeigniter - Parsing Variable into TCPDF -
my problem : undefined variable test. code :
<?php require_once('tcpdf/tcpdf.php'); extract ($datapr); $test = $datapr ['ref_no']; //print_r $test = 'pr/1.2.3.4/ok' class mypdf extends tcpdf { public function footer() { $test; } } ?>
problem undefined variable $test inside function footer. can me out?
try in side function
<?php require_once('tcpdf/tcpdf.php'); class mypdf extends tcpdf { // or rename footer index(); public function footer() { extract($datapr); // print_r $test = 'pr/1.2.3.4/ok' $test = $datapr['ref_no']; echo $test; } }
if controller first letter of class name should upper case my_pdf.php
, class my_pdf extends tcpdf {}
Comments
Post a Comment