|
构造函数
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 |
|