Search code examples
phpcodeignitermodels

Not able to load the module model file


I'm trying to figure out why the login controller won't load the user module model called user_model. I have also included the file structure. Id' like to point out I am using Jamie Rumbelow's MY_Model in my application found here. https://github.com/jamierumbelow/codeigniter-base-model

<?php 

if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Login extends Backend_Controller 
{
    public function __construct() 
    {
        parent::__construct();
        $this->load->model('user/user_model', 'user');
    }
}

<?php

class User_model extends MY_Model 
{    
    public function __construct()
    {
        parent::__construct();
    }
}

-application
    -modules
        -user
            -controllers
                login.php
            -models
                user_model.php

Solution

  • I was able to solve the problem by adding an extention onto the file name which I had missed.