[eluser]opel[/eluser]
Ok thanks everyone for their help, for anyone that stumbles across this here is my all my code to get multiple controllers.
At the end of config.php
Code:
/*
|--------------------------------------------------------------------------
| AUTOLOAD CONTROLLERS
|--------------------------------------------------------------------------
|
*/
function __autoload($class)
{
if(strstr($class,'_Controller'))
{
include_once(APPPATH . 'libraries/' . $class . EXT);
}
}
In libraries/MY_Controller.php (Variables can be passed to all extended controllers)
Code:
class MY_Controller extends Controller
{
function MY_Controller()
{
parent::Controller();
}
}
Code:
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class Base_controller extends Controller
{
public $navigation = NULL;
public $footer = NULL;
function Base_controller()
{
parent::Controller();
$this->navigation();
$this->footercopy();
}
function navigation()
{
$this->navigation['navigation'] = array("Home", "Test", "contact");
$this->data['frontend_navigation'] = $this->load->view ('common/frontend_navigation', $this->navigation, TRUE);
}
function footercopy()
{
$this->data['footer'] = '© '.date('Y').' '.$this->config->item('project');
}
}