Re: OOP, dynamic class extention
| From: | Marek Kilimajer | Date: | Thu, 30 Oct 2003 19:27:55 +0000 |
| Subject: | Re: OOP, dynamic class extention | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-168170@lists.php.net to get a copy of this message | ||
Why? I guess because php is interpreted language and is parsed only once, no preprocessor. Workaround is quite easy, use variable:
<?php
// settings to be set on install of the app
$MY_BASE_CLASS="base_class";
define("MY_BASE_CLASSFILE","base_class.php");
// require the class file
require_once(MY_BASE_CLASSFILE);
class my_child_class extends $MY_BASE_CLASS {
// yada yada
}
?>
Jackson Miller wrote:
On Thursday 30 October 2003 12:29 pm, Marek Kilimajer wrote:php is not c, you can't use constants this way.but why? Is there a work around? -Jackson