is there any setting to declare the member variables in constructor?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



now i'm re-writing some script to output pdf files. the original code
is based on fpdf, but as you know, fpdf can't deal with the characters
in utf8. so i want to change it to tcpdf. there is a class extend from
fpdf, in its constructor function, there is some script just like
"$this->db = $db;". there isn't any variable named "$db" in parent
class(class fpdf) and child class, i have checked it carefully and
"print_r($this)" at the top of child's constructor function. but after
"$this->db=$db", there is a member variable named $db(i have print_r
and check it too). when i change the parent class to tcpdf, although i
haven't change any code in child class and there isn't a member
variable named $db in parent class(class tcpdf), php returns me a
error "TCPDF ERROR: Cannot access protected property / Undefined
property". i print_r($this) at the top of constructor function again
and check whether there is a member variable named $db in both parent
and child class, finally i'm sure there isn't. i think maybe there is
a setting in the parent class(fpdf/tcpdf) here about this condition.
it controls whether you can declare a member variable by equaling it.
i tried to find it out on google or in fpdf/tcpdf sources but i
failed, there are about 16k lines in tcpdf.... so i post this mail to
request some help, is there somebody have any experience about this
case? please help me, thanks a lot.
solo

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux