Welcome Guest, Not a member yet? Register   Sign In
2.0.1 newbie
#1

[eluser]fiat[/eluser]
Hi There,

Long time php coder, first time framework user!

I've recently installed CI 2.0.1, and am wondering if I can get some guidance as to why this is failing


Code:
class Welcome extends CI_Controller {


     function Welcome()
     {
         parent::CI_Controller();
    
    
     }

    
    public function index()
    {
            $this->load->view('welcome_message');

}

Fails with a Fatal error

Call to undefined method CI_Controller::CI_Controller()

With CI 2 being so new, all the old tutorials (or any tutorial for that matter is now redundant.. So i'm wondering why this is failing?

Thanks
D
#2

[eluser]John_Betong_002[/eluser]
I hope you are not using PHP 4.XXX.

Try this instead of your Welcome function:

Code:
function __construct()
{
  parent::__construct();
}
 
 
 
#3

[eluser]fiat[/eluser]
thanks Summer,

That works great, I'm using php 5.3.6.

Cheers

D
#4

[eluser]Senthilguru[/eluser]
Hi,

FYI , CI2.X wont support PHP4 , thats why you got that issue.

Meanwhile , may i know why you are overriding the default constructor in your Welcome controller.

Hope you don't need to override that here , do that if you want to initialize variables or access checking like that.

Thanks,
Senthilguru.E




Theme © iAndrew 2016 - Forum software by © MyBB