我知道这个问题可能看起来重复,但我已经尝试了这些建议/建议,但仍然无法解决这个问题:
环境 :
$autoload['libraries'] = array('email', 'session', 'database', 'form_validation');
控制器 :
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Auth extends CI_Controller {
public function __construct()
{
parent::__construct();
$this->load->library('form_validation');
$this->load->model('Auth_model', 'Auth');
}
private function _login()
{
$email = $this->input->post('email');
$password = $this->input->post('password');
$user = $this->model->Auth->getUser();
模型 :
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Auth_model extends CI_Model
{
public function getUser()
{
$email = $this->input->post('email');
// var_dump($email);die;
return $this->db->get_where('t_user', ['email' => $email])->row_array();
}
}
我仍然收到此错误:
遇到 PHP 错误
严重性:通知
消息:未定义的属性:Auth::$model
文件名:控制器/Auth.php
行号:38
HUX布斯
临摹微笑