I am trying to make a script in which different classes (e.g. Database, Utilities, Config) are all used to form one central Main class. I have tried extending a chain of them:
Main -> Utilities -> Database -> Configuration
But how can I set the different parts so that they can be called like this:
<?php
$this->db->select("WAFFLES");
echo($this->config->app_path);
?>
You need to declare each new object as variable in your Main Class like:
etc.
While i’m not a professional coder i’ll considering a better approach than this. This kind of object-handling can cause a bloated main class and in the worst case you may face some performance issues.