I want to use a model in my controller. But if I instantiate [font=courier]CatwalkModel[/font] from my controller let's say [font=courier]IndexController[/font], it kept getting error that the [font=courier]CatwalkModel[/font] is not found:
Here is the error message I got:
Quote
Fatal error: Class 'CatwalkModel' not found in .... blah blah blah
How can I import the models that I stored in a [font=courier]modules/amodule/models[/font] folder from the [font=courier]modules/amodule/config/main.php[/font] folder ?
So here is the background why I am now meet this problem.
I have created a module, let's say module "A" that has loads a config file:
Within my module folder, I have created a config folder to store the main.php as the specific module configuration file. ([font=courier]application/modules/amodule/config/main.php[/font]):
Next, I developed a model namely [font=courier]CatwalkModel[/font] and stored it in the [font=courier]modules/amodule/models/CatwalkModel.php[/font]:
Right now, I also set the index.php to be hidden by providing the .htaccess file, and also set up the showScriptName to false in the [font=courier]application/config/main.php[/font]. Therefore, if you access from your local server like stated below, you will get an error saying that the page was not found (which was also in my plan to ask about this later actually, because it should work, but instead I got error saying page not found ??):