Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.
// 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 ?
But I does not seem like a good idea to create spaghetti dependencies like that. I get the sense that the Setup_HTML class is the View and the Module may be the Model. If so then: