Welcome Guest, Not a member yet? Register   Sign In
SOLVED : CI2 - Trouble extending the controller
#1

[eluser]minerbog[/eluser]
Hi Peeps,

Having problems extending the main controller in CI2. The below code worked in 1.7.3 (obviousley minus the CI bit!).

MY_Controller.php
Code:
<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class MY_Controller extends CI_Controller {

    function __construct()
    {
        parent::__construct();
        //$this->load-.>library('login');
        $this->output->enable_profiler();
    }    
}
And dashboard.php
Code:
<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Dashboard extends MY_Controller {

    function __construct();
    {
        parent::__construct();
    }
    
    function index()
    {
        $this->load->view('global/header');
        $this->load->view('global/comming');
        $this->load->view('global/footer');
        
    }
}

I just can not seem to find an answer anywhere. I have found many threads in the forums about this but none seem to answer the question.

Please Help!!

Gav.
#2

[eluser]minerbog[/eluser]
Oppps, typo!!!!

In the dashboard.php, notice the little ; at the end of the construct function line!!!

God I hate semi-colons!!!




Theme © iAndrew 2016 - Forum software by © MyBB