I’ve been looking for an answer on this site and have found a few people who have asked the same question however I haven’t found one that actually says the correct solutions.
I’m trying to figure out how I can have a master module hold certain variable values so that I can access them accordingly in other models. I’m running on a localserver on my computer and am also using the module plugin. I’m also auto-loading the master_model.
The problem is that I’m getting an error message saying the master_model can not be found from within the users_model.
$autoload['model'] = array('msgboxes', 'metatags', 'genfunc', 'adverts', 'master_model');
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
/**
* Master_model
*
* @author Jeff Davidson
*/
class Master_model extends CI_Model
{
function __construct()
{
parent::__construct();
}
var $users_table = 'users';
var $user_profiles_table = 'user_profiles';
var $user_login_sessions_table = 'user_login_sessions';
var $user_statuses_table = 'user_statuses';
var $user_roles_table = 'user_roles';
}
/* End of file master_model.php */
/* Location: ./application/models/master_model.php */
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
/**
* Users
*
* This model represents user authentication data. It operates the following tables:
* - user account data,
* - user profiles
*
* @package KOW Auth
* @author Jeff Davidson
*/
class Users_model extends Master_model
{
function __construct()
{
parent::__construct();
}
}
/* End of file users_model.php */
/* Location: ./application/modules/users/models/users_model.php */
You need to place the
Master_modelin theapplication/coredirectory and add the following code to theapplication/config/config.phpfile:Read more here.