Viral Bhoot
Viral Bhoot

Reputation: 357

I want to call model in modules folder in autoload file

Here I want to call birthday_model in autoload but I am getting error in that.

Unable to locate the model you have specified: birthday_model

My folder structure is:

modules/birthday/model/birthday_model

Autoload:

$autoload['model'] = array('HookModel','AppModel','Birthday_model');

birthday_model:

class Birthday_model extends CI_Model
{
    public function __construct()
    {
        parent::__construct();
        $this->load->database();
    }
}

Here I want to call birthday_model in other controller of "dailyattendance",

modules/dailyattendance/dailyattendance

Upvotes: 0

Views: 57

Answers (2)

Keval Rathi
Keval Rathi

Reputation: 986

Try this,

$autoload['model'] = array('HookModel','AppModel','birthday/model/Birthday_model');

Upvotes: 1

Kundan Sharma
Kundan Sharma

Reputation: 189

Change your model name "birthday_model" to "Birthday_model".

Upvotes: 0

Related Questions