Including files within a class definition
| From: | Cameron Just | Date: | Mon, 05 Jul 2004 01:57:07 +0000 |
| Subject: | Including files within a class definition | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-189677@lists.php.net to get a copy of this message | ||
Hi,
I have a program which generates classes based on table structures within
a database. However there are a few times where I need to put custom
methods within these generated classes.
I want to be able to do this but php gives an error for the following include
class generatedClass {
var $this = 0;
function here($strVar){
echo 'this';
}
include (extended_methods_stuff.php);
}
I know that I can probably extend this class to add the extra
functionality however the other generated classes rely on the name of this
class so I cannot just extend this class and it's name cannot change.
Is there any way to have an include prior to the class being parsed?