Hi all. I have a current PHP script which checks a number of GET, POST, and REQUEST variables. These are currently in a top-down PHP file and these variables control the flow of the application. I want to convert file to a PHP class, create an object and then access the class functions to perform actions in my application. I'm wondering are there any problems with creating a PHP like this:
class foo {
function __ construct() {
}
function fooBar() {
if($GET['param1'])
return 1;
return 0;
}
};
$obj = new foo();
And then in my other documents I can just check the value of fooBar via:
<?php if(fooBar()) {....} ?>
Now this isn't exactly what I'm trying to do but it illustrates it. Is this good? i.e. proper practice? If not, how can I accomplish what I'm trying to do.
Thanks.