• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Class 'Controller' not found when creating MY_Controller using HMVC

#1
[eluser]Isern Palaus[/eluser]
Hello,

I'm trying to create a MY_Controller to extend it with my Controllers and I can't get it working.

I asked this for 1.7.2 and problem was that I wasn't using the __autoload() suggested by Phil on his blog but I assumed that this will work without his patch on 2.0. I tried and fails, I tried with adding the function __construct() on config.php and doesn't works.

I'm using the last source version of HMVC (from bitbucket) by wiredesignz.

/application/core/MY_Controller.php
Code:
<?php (defined('BASEPATH')) OR exit('No direct script access allowed');

class MY_Controller extends Controller
{
    
    public function __construct()
    {
        parent::Controller();
    }
    
}

I also tried parent::__construct();

Error:
Quote:Fatal error: Class 'Controller' not found in /home/*****/****/trunk/src/application/core/MY_Controller.php on line 3

Thank you in advance

#2
[eluser]moodh[/eluser]
extends CI_Controller

#3
[eluser]Isern Palaus[/eluser]
[quote author="narcisha" date="1296762271"]extends CI_Controller[/quote]

Tried: Call to undefined method CI_Controller::ci_controller()

#4
[eluser]moodh[/eluser]
[quote author="Isern Palaus" date="1296762442"][quote author="narcisha" date="1296762271"]extends CI_Controller[/quote]

Tried: Call to undefined method CI_Controller::ci_controller()[/quote]


lala extends CI_Controller
{
function __construct() {
parent::__construct();
}
}

#5
[eluser]Isern Palaus[/eluser]
[quote author="narcisha" date="1296762519"][quote author="Isern Palaus" date="1296762442"][quote author="narcisha" date="1296762271"]extends CI_Controller[/quote]

Tried: Call to undefined method CI_Controller::ci_controller()[/quote]


lala extends CI_Controller
{
function __construct() {
parent::__construct();
}
}[/quote]

It work! Thank you!


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.