Re: [PHP] OOP, dynamic class extention

2003-10-30 Thread Boyan Nedkov
Hey guys, you can extend a _class_ from an existing _class_ but not from a _string_constant_ (Ex1 - MY_BASE_CLASS is evaluated to constant of type string) neither from a _string_variable_ (Ex2 - $my_base_class_var is a variable of type string). To be able to use different base classes with the

Re: [PHP] OOP, dynamic class extention

2003-10-30 Thread Jackson Miller
On Thursday 30 October 2003 02:15 pm, Marek Kilimajer wrote: > Can you show it once again. In your first email you use a constant, not > variable. Sure. In my first email I said that I had tried with a variable too (but didn't show the code). Ex1 gives a "cannot inherit from undefined class" err

Re: [PHP] OOP, dynamic class extention

2003-10-30 Thread Marek Kilimajer
Jackson Miller wrote: On Thursday 30 October 2003 01:27 pm, Marek Kilimajer wrote: Why? I guess because php is interpreted language and is parsed only once, no preprocessor. Workaround is quite easy, use variable: I thought that too, and tried it before posting to the list (it was at the bottom

Re: [PHP] OOP, dynamic class extention

2003-10-30 Thread Jackson Miller
On Thursday 30 October 2003 01:27 pm, Marek Kilimajer wrote: > Why? I guess because php is interpreted language and is parsed only > once, no preprocessor. Workaround is quite easy, use variable: I thought that too, and tried it before posting to the list (it was at the bottom of my first email).

Re: [PHP] OOP, dynamic class extention

2003-10-30 Thread Marek Kilimajer
Why? I guess because php is interpreted language and is parsed only once, no preprocessor. Workaround is quite easy, use variable: // 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_BAS

Re: [PHP] OOP, dynamic class extention

2003-10-30 Thread Jackson Miller
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 > > Jackson Miller wrote: > > I want to be able to set a base class in a settings file, and then have > > other classes extend the base class,

Re: [PHP] OOP, dynamic class extention

2003-10-30 Thread Marek Kilimajer
php is not c, you can't use constants this way. Jackson Miller wrote: I want to be able to set a base class in a settings file, and then have other classes extend the base class, but PHP won't let me do what I have tried. I get the following error: Fatal error: Class cepweb: Cannot inherit from

Re: [PHP] OOP, dynamic class extention

2003-10-30 Thread Jough Jeaux
Shouldn't this line: class my_child_class extends MY_BASE_CLASSFILE { Read like this: class my_child_class extends MY_BASE_CLASS { After all "base_class.php" isn't the name of your class, "base_class" is. Jackson Miller <[EMAIL PROTECTED]> wrote: I want to be able to set a base class in a setti

[PHP] OOP, dynamic class extention

2003-10-30 Thread Jackson Miller
I want to be able to set a base class in a settings file, and then have other classes extend the base class, but PHP won't let me do what I have tried. I get the following error: Fatal error: Class cepweb: Cannot inherit from undefined class my_base_class in /home/me/my_child_class.php on line 1