我使用的代码点火器结构如下:文件名-用户,ControllerClassName-用户型号ClassName-用户型号
并点击url:http://localhost/ci/user如果我命中,它显示404http://localhost/ci/User工作正常,但无法定位User_model
如果我使用Filename作为用户,user_model而不是user,user_model,它可以完美地工作
我正在使用代码点火器2
这个问题有什么解决方案吗?它在ubuntu 14.04 上不起作用
在__construct()
中加载模型
function __construct()
{
parent::__construct();
$this->load->model('User_model');
$this->load->library('Session');
}
在模型中
文件名-user_model.php
内部文件
if (!defined('BASEPATH'))
exit('No direct script access allowed');
class User_model extends CI_Model {
function __construct()
{
parent::__construct();
}
}
在控制器中
文件名-user.php
内部文件
if (!defined('BASEPATH'))
exit('No direct script access allowed');
class User extends CI_Controller
{
}