刚刚开始一个项目, 本地环境搭建的局域网访问/ autoload其他正常,但是加载model后在控制器调用不到, 同样的代码在同事电脑环境下可以正常访问,自己电脑就不行
autoload.php 配置文件
$autoload['model'] = array('select_model');
Model代码:
<?php defined('BASEPATH') OR exit('No direct script access allowed');
/**
*
* @authors 摇耳朵的小布丁(755969423@qq.com)
* @date 2017-08-11 09:14:41
* @version $查询模型Model$
*/
class Select_model extends CI_Model {
function __construct(){
parent::__construct();
}
//查询单条/一条信息
public function selectOne($table, $where=array())
{
return "123";
}
}
Login控制器中调用
<?php defined('BASEPATH') OR exit('No direct script access allowed');
/**
*
* @authors {755969423@qq.com)
* @date 2017-06-30 04:11:21
* @version $Id$
*/
class Login extends CI_Controller {
public function __construct()
{
parent::__construct();
}
public function index()
{
if($_POST){
$this->load->library('form_validation');
if ($this->form_validation->run('login') == FALSE){
$this->load->view('user/login.html');
}else{
redirect('Nasa');
}
}else{
$aa=$this->select_model->selectOne('table name');
echo $aa;
exit;
$this->load->view('user/login.html');
}
}
}
错误信息
A PHP Error was encounteredSeverity: Notice Message: Undefined property: Login:select_model Filename: controllers/Login.php Line Number: 38 Backtrace: File: D:\wamp64\www\xijiaoa\App\controllers\Login.php
Line: 38
Function: _error_handler File: D:\wamp64\www\xijiaoa\index.php
Line: 315
Function: require_once
|