I am having trouble with extending and including classes in an application I am trying to develop. I have (for the most part) one class per file in my app. I was going along great until I got this error:
Cannot inherit from undefined class ...
Here is the basics of what I have:
file: base.php
class base {
...
}
file ext1.php
require_once "base.php"
class ext1 extends base {
...
}
file ext2.php
require_once "base.php"
class ext2 extends base {
...
}
file repository.php:
require_once "base.php"
require_once "ext1.php"
require_once "ext2.php"
class repository {
... //use simple functions from the included classes.
}
file test.php
require_once "ext2.php"
$ext2 = new ext2();
I am guessing that this should be enough example code to diagnose my problem. I can post a link to the actual code (zipped) if necessary. I suppose I should mention that I am a Java programmer by day, so I may be trying to code this like java.
Thanks in advance.