I have the following php errors :
A PHP Error was encountered
Severity: Notice
Message: Undefined variable: t
and
A PHP Error was encountered
Severity: Warning
Message: Missing argument 1 for myclass::__construct(), called in xxx on line 1011 and defined
My controller contains :
$this->load->model('mymodel');
$i = $this->mymodel->func(1);
print_r($i);
mymodel :
$test = new myclass("foo", "bar");
$myarray[] = $test;
return $myarray
myclass :
class myclass {
var $a;
var $b;
public function __construct($t, $l) // ERROR 2
{
$this->a = $t; // ERROR 1
$this->b = $l;
}
}
Note that print_r($a) in controller prints the correct object with content..
Thanks