Jump to content

OOP - Address Bar / Link Class


johnsmith153

Recommended Posts

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.

Link to comment
https://forums.phpfreaks.com/topic/220316-oop-address-bar-link-class/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.