[eluser]nydeveloper[/eluser]
Quote:try like this
Code:
class Simple_model extends CI_Model
{
public $var = '';
public function your_method1() {
$this->var = $some_value;
}
public function your_method2() {
echo $this->var;
}
}
hope this would help you.
I've tried a few variations of the above, but am having no luck. The variable(s) in question are still not being recognized by any functions other than the one which extracts data from the array and assigns it to the respective variable(s). I still receive the 'undefined variable' error each time when trying to use them in another function within the same model.
Does anyone have any other suggestions on how I can achieve this? Thanks.