Welcome Guest, Not a member yet? Register   Sign In
CI_model not found
#1

Because of my previous issue trying to load classes within a controller I started to use models in my code.

One thing I am puzzled with how can I share my toolkit. Now I have everything inherited from the top class which is a child of CI_controller.
When I start inheriting form CI_model I must duplicate my general purpose code.

The main issue is this:

Fatal error: Class 'CI_Model' not found in /Applications/MAMP/htdocs/b4y_v20ez/application/models/Ezbuild_main_model.php on line 10

The code is like this:


PHP Code:
[color=#000000][size=medium][font=Times]class Ezbuild_main_model extends CI_Model {

  function __construct() {
    parent::__construct();
  }[/font][/size][/color

I checked the file and classname.

I hope for some help.

John
Reply
#2

(This post was last modified: 08-24-2017, 11:21 AM by InsiteFX.)

Try creating a MY_Model in ./application/core that extends the CI_Model then extend your Models from the MY_Model

You need to sit down and read the CodeIgniter Users Guide.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply




Theme © iAndrew 2016 - Forum software by © MyBB