用户
 找回密码
 入住 CI 中国社区
搜索
查看: 1402|回复: 4
收起左侧

[HELP] model的问题

[复制链接]
发表于 2014-8-6 11:18:37 | 显示全部楼层 |阅读模式
本帖最后由 aammjian 于 2014-8-6 11:26 编辑

Fatal error: Class 'User_model' not found in D:\xampp\htdocs\WorkPlan\system\core\Loader.php on line 303

具体的代码
PHP复制代码
 
<?php>class User_model extends CI_Model{
        public function  __construct
        {
                $this->load->database();
        }
        public function get_user($login='admin'){
 
                $query = $this->db->get('tk_user');
                return $query->result_array();
 
                $query = $this->db->get_where('tk_user',array('tk_user_login'=>$login));
        }
}
 
 
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
 
class Userlog extends CI_Controller {
        public function index()
        {
                 $this->load->helper("url");  
                 
                 $this->load->model('User_model');
               
                $data = array('msg_Title' => '用户登录!','msg_Welcome' => '欢迎使用信息平台');
               
                // $data['user'] = $this->user_model->get_user();
                $data['name'] = '登录名';
                $this->load->view('user_log',$data);
        }
}
 
 
复制代码


发表于 2014-8-6 13:16:26 | 显示全部楼层
<?php>class User_model extends CI_Model{
        public function  __construct
        {
                parent::__construct();
                $this->load->database();
        }

加上试试
 楼主| 发表于 2014-8-6 13:58:21 | 显示全部楼层

找到原因了 是<?php>后面的这个尖括号,刚学php不了解。
发表于 2014-8-6 14:03:27 | 显示全部楼层
aammjian 发表于 2014-8-6 13:58
找到原因了 是后面的这个尖括号,刚学php不了解。

{:soso_e103:}
 楼主| 发表于 2014-8-6 14:37:25 | 显示全部楼层

呵呵 还是很感谢的,下次有问题继续请教。

本版积分规则