Hi folks:
Would anyone please tell me how to solve this problem!
I have 2 classes, says Header and Footer both extend class MainPage as follow:
class MainPage {
...
}
class Header extends MainPage {
...
}
class Footer extends MainPage {
...
}
Then, I try to create the Header and Footer in Home class.
class Home {
...
function load() {
$header = new Header();
$footer = new Footer();
$header->render();
$footer->render();
}
}
If I run a php file to call the $home->load() function, I get "Fatal error: Cannot redeclare class mainpage in mainpage.php". I thought header and footer were two different instance. Why there is a problem?
Thanks in advance!
Billy