Normal use of MVC

edited April 2012 in Installation
I have been digging into FUEL CMS for two days now, but I have to admit that it does not get much clearer to me at the moment.
I am familar with codeIgniter and I am trying to use the normal approach of MVC in FUEL cms. However even the simplest try already results in errors.

My example: I am just trying to use the controller in the way that it is done in codeIgniter. I have controller file called: testcontroller.php. It contains the following code:

class Testcontroller extends CI_Controller { function __construct() { parent::__construct(); } function index () { echo 'test'; } }

Now if I try to open this location at my local host I get the following error:
Fatal error: Call to undefined function fuel_nav() in C:\wamp\www\FUEL-CLEAN\fuel\application\views\_variables\global.php on line 9

Now I have the feeling that I miss some (simple) understanding of what I am doing wrong. I have followed the tutorials but they all use a different approach than in CI. I would like to build my site like in CI and only add the cms functionality when necessary. This should be possible right?

Comments

  • edited 5:44AM
    Your controller seems fine. I can't reproduce this error on my local fuel with xampp so I'm thinking there might be something wrong with wamp or your fuel installation.

    fuel_nav is part of the fuel_helper which should be loaded by default but I suggest you check config/autoload.php for $autoload['helper'] near line 53; It should contain "fuel/fuel" in the array which I think is the fuel_helper in the fuel module.
  • edited 5:44AM
    The autoload does contain fuel/fuel. It is weird because the contact page of widgi corp does function. And this also extends CI_controller in the same way. Very strange.
  • edited 5:44AM
    I'm not quite sure at the moment what the issue may be either. I would start by debugging perhaps the parent Controller at fuel/codeigniter/core/Controller.php and making sure it is getting executed. This file does the the autoloading in the constructor. Let us know what you find out or if you have any other additional clues.
  • edited 5:44AM
    Okay so I created a new file and tried it again a couple of times and now it functions. Must have been something wrong with the naming of my file orso..

    Thanks for the answers. And thanks for FUEL cms, because the more I dive into it the more I start to realize its power and flexibility.
Sign In or Register to comment.