1
即時通訊使用CodeIgniter 2.0.2,我注意到從模型中調用模型時,你不需要加載它。CodeIgniter模型調用模型
例如,在一個控制器,你需要寫
$this->load->model('my_model');
$this->my_model->my_function();
但在模型它可以加載就像這樣
$this->my_model->my_function();
我應該避免寫我這樣的代碼,或者是這個安全?
我不確定CI的內部工作原理,但是您確定只是沒有在控制器中加載該模型?我認爲這應該讓它可以在其他模型加載在這種情況下 – danneth
@danneth - 啊是的,這一定是它是什麼。好吧,這是有道理的。 – cnotethegr8