0
嘗試從codeigniter幫助器文件訪問用戶類對象時,其拋出錯誤如Class 'User' not found
。我的代碼類似於 $u = new User(); $u->get();
我可以在庫文件中使用此功能,但不能在助手文件中使用此功能。有人可以幫助我嗎?在使用wanwizard數據映射器時在codeginiter幫助器文件中調用模型類對象
嘗試從codeigniter幫助器文件訪問用戶類對象時,其拋出錯誤如Class 'User' not found
。我的代碼類似於 $u = new User(); $u->get();
我可以在庫文件中使用此功能,但不能在助手文件中使用此功能。有人可以幫助我嗎?在使用wanwizard數據映射器時在codeginiter幫助器文件中調用模型類對象
爲了幫助中使用的模型,你必須:
// Get a reference to the controller object
$CI = get_instance();
// You may need to load the model if it hasn't been pre-loaded
$CI->load->model('User');
// Call a function of the model
$CI->User->get();
希望這將有助於!
對不起,這力量幫助我 – Anusha