[請益] CI 3.0, Unable to locate the model
各位版大好
我在設定db連接的時候遇到下列的錯誤訊息
Unable to locate the model you have specified: Customermodel
照著google找到的訊息,大概都是說我大小寫設定好就可以解決了
可是照著做還是噴錯,想請益一下可能還有哪邊沒有設定好?
以下是程式碼:
controller/Login.php
<?PHP
if ( !defined('BASEPATH')) OR exit('No direct script access allowed');
class Login extends CI_Controller{
puclic funtion save(){
$this->load->model('customermodel');
$this->customermodel->insert($firstName, $lastName);
}
}
models/customermodel.php
<?PHP
if( !defined('BASEPATH')) OR exit('No direct scirpt access allowed');
class Customermodel extends CI_Model{
public funtion __construct()
{
parent::__construct();
}
function insert($firstName, $lastName){
$this->db->insert('customer_data',
Array("firstName" => $firstName,
"lastName" => $lastName
));
}
}
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 203.75.167.229
※ 文章網址: https://www.ptt.cc/bbs/PHP/M.1438318551.A.80E.html
→
07/31 13:06, , 1F
07/31 13:06, 1F
→
07/31 13:07, , 2F
07/31 13:07, 2F
→
07/31 13:39, , 3F
07/31 13:39, 3F
→
07/31 13:39, , 4F
07/31 13:39, 4F
推
07/31 15:30, , 5F
07/31 15:30, 5F
謝謝,如k大所說,把檔名改大寫就可以了
印象中2.2用小寫是對的,我先來爬一下CI 3.0的changelog
※ 編輯: qm29213039 (203.75.167.229), 07/31/2015 16:15:43
→
08/01 19:36, , 6F
08/01 19:36, 6F
→
08/01 19:38, , 7F
08/01 19:38, 7F
推
08/21 09:01, , 8F
08/21 09:01, 8F
推
02/05 14:02, , 9F
02/05 14:02, 9F
→
02/05 14:02, , 10F
02/05 14:02, 10F
→
02/05 14:04, , 11F
02/05 14:04, 11F
PHP 近期熱門文章
PTT數位生活區 即時熱門文章