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 settings
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
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, but
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
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).
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
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 error
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
8 matches
Mail list logo