CI构造函数里new后出错
构造函数function __construct()
{
parent::__construct();
$this->load->model('tmp');
$tmp = new tmp();//加上后就出错,在用到的方法里new就没这个错误
}
下面方法里的错误位置
$this->load->helper('form');
$this->load->library('form_validation');
$this->form_validation->set_error_delimiters('', '');
错误信息
PHP Fatal error:Call to a member function set_error_delimiters() on a non-object in E:\work\trunk\dashboard\app\controllers\account_number\pnbind.php on line 70
我就想在构造函数里new另一个类的对象出来,可以在该类所有方法里调用,不需要每个方法自己new CI 的类库不需要 new,请参考手册来使用 CI,不要按自己的想法去使用。 看手册嘛先 不需要 new
页:
[1]