I have a simple form field with 3 input fields. I am trying to use the oop concept to write the code.
Is it good practice to get the request values in constructor, so that I can use these values in every method.
function __construct()
{
$this->country = mosgetparam( $_REQUEST, 'country','');
$this->month = mosgetparam( $_REQUEST, 'month','');
$this->year = mosgetparam( $_REQUEST, 'year','');
}
This is just an older version of joomla. So no need to bother about the syntax.
Note: more info: I am submitting the form with country, month and year. I need these values to generate some reports. So is it okay to set the values in constructor so that I can get these values inside the methods?