Re: [PHP] OOP, dynamic class extention
From: Marek Kilimajer (kilimajer_at_webglobe.sk)
Date: 10/30/03
- Next message: Mike Migurski: "Re: [PHP] removing all duplicate values from an array"
- Previous message: Patrick Fowler: "new install php not working. Please help."
- In reply to: Jackson Miller: "Re: [PHP] OOP, dynamic class extention"
- Next in thread: Jackson Miller: "Re: [PHP] OOP, dynamic class extention"
- Reply: Jackson Miller: "Re: [PHP] OOP, dynamic class extention"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 30 Oct 2003 20:27:55 +0100 To: Jackson Miller <jackson@coldfeetcreative.com>
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
>
- Next message: Mike Migurski: "Re: [PHP] removing all duplicate values from an array"
- Previous message: Patrick Fowler: "new install php not working. Please help."
- In reply to: Jackson Miller: "Re: [PHP] OOP, dynamic class extention"
- Next in thread: Jackson Miller: "Re: [PHP] OOP, dynamic class extention"
- Reply: Jackson Miller: "Re: [PHP] OOP, dynamic class extention"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|