owf :
I know this quention might seems duplicated, but i already tried those suggestions/advice but still couldn't solve this:
environment :
$autoload['libraries'] = array('email', 'session', 'database', 'form_validation');
controller :
<?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();
Model :
<?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();
}
}
I Still got this error :
A PHP Error was encountered
Severity: Notice
Message: Undefined property: Auth::$model
Filename: controllers/Auth.php
Line Number: 38
Boominathan Elango :
Change
$user = $this->model->Auth->getUser();
into
$user = $this->Auth->getUser();
Guess you like
Origin http://43.154.161.224:23101/article/api/json?id=346825&siteId=1