Использование моделей CI_Version 2.2.1, не подключенных к контроллеру. Я получаю сообщение об ошибке типа
Неопределенное свойство: Администратор::$administrator_model & Неустранимая ошибка: вызов функции-члена admin_authentication() для объекта, не являющегося объектом...
class Administrator extends CI_Controller
{
public function _construct()
{
parent::__construct();
$this->load->model('administrator_model');
}
public function login_authentication()
{
$username = $this->input->post('username');
$password = $this->input->post('password');
$check_login = $this->administrator_model->admin_authentication($username, $password);
}
}
Модель:
class Administrator_model extends CI_Model
{
function __construct()
{
parent::__construct();
}
public function admin_authentication($username,$password)
{
$this->db->select('*');
$this->db->from('user_credential');
$this->db->where('db_username', $username);
$this->db->where('db_password', $password);
$query = $this->db->get();
return $query->result_array();
}
}
Подробнее: https://stackoverflow.com/questions/292 ... ntiated-in