[eluser]Unknown[/eluser]
I have a class that has multiple functions in it. There are some variables that I want to be referenced upon through-out the whole controller class.
I have the following variables
Code:
$affid = $this->session->userdata('affid');
$startdate = preg_replace('/[^\d-]+/', '', $this->input->get_post('start'));
$enddate = preg_replace('/[^\d-]+/', '',$this->input->get_post('end'));
if(!$startdate)
{
$startdate = date("Y-m-d");
}
if(!$enddate)
{
$enddate = date("Y-m-d");
}
$getsort = htmlspecialchars($this->input->get_post('sort'),ENT_QUOTES);
$direction = htmlspecialchars($this->input->get_post('dir'),ENT_QUOTES);
if($getsort && $direction)
{
$sort[$getsort] = $direction;
}
I want these variables with these values to be able to be called upon in other functions
inside my controller class.
I tried putting the above code in my constructor, but the variables cannot be referenced in any other
functions within the class besides the constructor.
Any suggestions on how I can make variables global to my class?