Forum Moderators: coopster
Thanks in advance!
I want to create one "parent class" (the BaseSystem), which has a few children. One child is for the connection with the DB, another for fetching data from the DB about the current page. So I have a few other classes. These "chlidren" need to interact with eachother. For example: the "currentpage class" need the DB class for retrieving data from the DB.
Greetzz Tha WebMasteR
BaseSystem --> The main class, which stores information about the requested page
¦-> Database --> This is a class which needs to get the mysql_connect settings from the basesystem and is used for executing queries from other classes
¦-> CurrentPage --> This is the class which fetches the page from the db using the Database-class and analyses whether it might be displayed and so forth.
the lines starting with "¦->" are subclasses of the BaseSystem class.
My problem here is that the subclasses need to interact with eachother (The currentPage-class needs to access members at the Database-class).
Get it now?
In VB you have a project that eventually gets compiled into a .dll file. Within that project you can have classes that do specialized things like handle database connections and queries, another to handle user input validation, another for formatting, and so on. I can call those classes from other classes or even directly from a web page.
I'm not sure this applies to PHP but hopefully it will help clarify what I think it is you're trying to do so that someone else who does know PHP can help you.
I think I can't use the "extends BaseSystem" in all other classes, because the BaseSystem is used to store a few variables and the classes can't interact with eachother.