我希望我能在这里解决未定义的属性:Siswa::$Siswa_model


i hope i can solve here Undefined property: Siswa::$siswa_model

,消息:在null Filename:controllers/siswa.php上调用成员函数get_paged_list((这是我的完整代码http://pastebin.com/ZBHkBS8i

由于baci和bora ,问题得到了解决

您不应该像这样调用模型

$siswas = $this->siswa_model->
get_paged_list($this->limit,$offset,$order_column,$order_type) ->result();

但是像这个

$this->load->model("siswa_model");
$result = $this->siswa_model->
get_paged_list($this->limit,$offset,$order_column,$order_type)

在模型中,您应该查询数据库并返回结果,类似于

public function get_paged_list($limit,$order_column,$order_type)
{
$q_str = "select * from table ....etc ";
$q = $this->db->query($q_str);
return $q->result();
}

希望对有所帮助