我的模型文件名是 M_zwall.php
:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class M_zwall extends CI_Model {
public function __construct(){
parent::__construct();
}
public function getLastWallpapers($start = 0,$end = 0)
{
$this->db->select('*');
$this->db->from('wallpapers');
$this->db->limit(10,$start);
return $this->db->get()->result();
}
}
?>
我在控制器中加载了这个模型:
$this->load->model('m_zwall');
消息:无法找到您指定的模型:M_zwall
public function __construct(){
parent::__construct();
$this->load->model('m_zwall');
}
Try this.
$this->load->model('M_zwall');
尝试将文件名M_zwall.php更改为M_zwall.php