johnsmith153 Posted December 1, 2010 Share Posted December 1, 2010 I am thinking of creating a class that will be instantiated first in all scripts and will gather all details of the url entered and store as properties of the class. I use mod_rewrite so the url needs to be split up and stored in various ways. This class would deal with all POST and GET variables and be pretty important and used a lot. If a link needs generating (so to convert the current one into the mobile site one) or some other server-side generation then this class would also provide the results for that. If a server-side redirection was needed then this class would do that. (1) Does this sound like good OOP design as I'm not sure? (2) The problem is that this class would be used so many times by nearly all other classes that I don't know how to make the instance available to these other classes. It could be used by every class. Global?? Passing in to EVERY other instantiated class?? Neither seem a great idea. Quote Link to comment https://forums.phpfreaks.com/topic/220316-oop-address-bar-link-class/ Share on other sites More sharing options...
trq Posted December 1, 2010 Share Posted December 1, 2010 Most php frameworks have a request object (which it kinda sounds like your describing) that gets passed around through most of the process. Quote Link to comment https://forums.phpfreaks.com/topic/220316-oop-address-bar-link-class/#findComment-1141678 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.