Oh, I see. I guess I am just presuming that you modified something because the core files are combined into the one class in your CMS. I still can’t work out what is going on, so I’ll provide some extra detail in the hopes that someone can assist me.
Here is MY_Controller:
require APPPATH."third_party/MX/Controller.php";
class MY_Controller extends MX_Controller {
public $CMS;
// Setting variables
public $settings = array();
public function __construct()
{
// Constructor
parent::__construct();
// Get instance of Codeigniter object
$this->CMS = &get;_instance();
// Gets settings from database
$this->_init_settings();
}
// Gets settings from database and stores them
public function _init_settings()
{
$settings = $this->db->get('settings');
foreach ($settings->result_array() as $row)
{
// go through the settings table and pull out lots of stuff
$this->config->set_item($row['setting_name'], $row['setting_value']);
// set MY_Controller variables (to save function class to config)
$this->settings[$row['setting_name']] = $row['setting_value'];
}
}
}
I have MY_Controller, MY_Loader and MY_Router inside of the core directory inside of my application directory. In my libraries folder I have Dwoo and MY_Router (same code you posted on your blog Phil) for using Dwoo with the Codeigniter parser.
Inside of my auth module I have the following directories and files:
Auth
Config
ion_auth.php
Controllers
auth.php
Language
(a whole heap of language directories for multiple languages from Ion Auth)
Libraries
Ion_auth.php
Models
ion_auth_model.php
Views
(just the views that come within the download Ion auth package)
In my application/config/routes.php file I have the following code:
$route['default_controller'] = "pages/pages"; // Pages controller is the default controller
$route['admin'] = "admin"; // Main admin controller
$route['(:any)/admin'] = "$1/admin"; // Individual module admin controllers
$route['(:any)'] = "pages/pages/$1"; // Every request to the pages controller
If there is anything else I can supply, please let me know. I would really like to get config files in my modules to load. Is there perhaps another hacky way like including the config file if I can’t get it to work and nobody can help me?
Thank you.