class - Should I be passing S_ variables into functions - PHP -


i building little website project on side , having go @ mvc.

i have built request class, , router class.

simple enough question, have read on place globals bad such whatever reason, should passing in, $_get, $_post, $_server etc request class, or referencing them inside request class.

new request($_get, $_post, $_server); 

or

new request(); 

thanks.

one of main aspects of oop abstraction. class should not know global variables. if change key of get. first method common way.


Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

css - Firefox for ubuntu renders wrong colors -