Welcome Guest, Not a member yet? Register   Sign In
Where to put plain object classes?
#36

That error should not occur if you use $this->load->model(), but it will probably occur if you load the model some other way (such as via an external autoloader). If you intend to autoload the class, it probably shouldn't extend CI_Model.

As for the rest, it's simply a different way of writing code. I understand the desire to not have $this cluttered with everything which might be loaded by CI, but it can certainly be convenient in some cases. There's nothing stopping you from creating models which don't extend CI_Model (or even a base model which doesn't extend CI_Model), but you do have to remember that when you extend the CI classes you may be requiring the use of CI's loader for your classes.
Reply


Messages In This Thread
Where to put plain object classes? - by geekita - 12-02-2014, 05:51 AM
RE: Where to put plain object classes? - by mwhitney - 01-02-2015, 01:26 PM
RE: Where to put plain object classes? - by Jamie - 01-06-2015, 05:18 AM
RE: Where to put plain object classes? - by Jamie - 01-06-2015, 03:08 PM



Theme © iAndrew 2016 - Forum software by © MyBB