Instance accessing classes functions
Posted: Mon Feb 26, 2007 7:07 pm
I have the following class structures
Now my question is how do I make available the Module classes functions to the Setup_HTML class? Is it just a matter of passing the Modules object to the setup class upon instantiation or is there a neater approach ?
Jeffery
Code: Select all
// Module class
class Module extends Core
{
// Some functions here which need to be accessed by the Setup class
}
// and then the Core class
Class Core
{
function __construct()
{
// Setup the Setup Class instance
$this->set_setup();
}
function set_setup()
{
if (!isset($this->setup) && !is_object($this->setup))
{
require("core/setup/setup_html.php");
$this->setup = new Setup_HTML();
}
}
}
Now my question is how do I make available the Module classes functions to the Setup_HTML class? Is it just a matter of passing the Modules object to the setup class upon instantiation or is there a neater approach ?
Jeffery