我在哪里做错了?我试图解决它,但没有。我做的很好,我是第一次出现这个错误。
Fatal error: Call to undefined method Team_model::exist_team() in C:\wamp\www\example\application\libraries\teams.php on line 28
这是我的图书馆:
class Teams { // My class
function __construct()
{
$this->ci =& get_instance();
$this->ci->load->model('team_model');
}
function exist_team($team_id) { // this function give me that error
if ($query_get_info = $this->ci->team_model->exist_team($id_team)) { // line with error
return $query_get_info[0];
} else {
return false;
}
}
}
这是我的模型
class Team_model extends CI_Model {
function exist_team($id_team) { // function exixst team in library
$this->db->select('*');
$this->db->from('teams');
$this->db->where('url',$id_team);
$query = $this->db->get();
if ($query->num_rows() == 0) {
return false;
} else {
return $query->result();
}
}
}