|
出现的问题:
A PHP Error was encounteredSeverity: Notice
Message: Undefined property: Note:Note_model
Filename: controllers/note.php
Line Number: 19
Fatal error: Call to a member function index() on a non-object in D:\www\dilicms\application\controllers\note.php on line 19
1.我的控制器是note.php
代码如下:<?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
class Note extends CI_Controller{
function __construct()
{
parent::__construct();
}
function index()
{
$this->load->model('note_model');
$data['item']=$this->Note_model->index();
$this->load->view('noteview',$data);
}
function save(){
}
function xianshi(){
}
}
?>
2.模型note_model.php
代码如下:
<?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
class Note_model extends CI_Model {
var $obj = '';
var $zfcontent = '';
var $author = '';
function __construct(){
parent::__construct();
}
function index(){
$query = $this->db->query('select * from dili_u_m_content');
return $query->result();
}
}
?>
|
|