Avoiding massive controller: where to put individual files |
I truly appreciate the extra detail and links you've provided here.
It seems pretty clear that the only things that should go in core are classes that extend/replace/mimic CI_* classes that are native to CodeIgniter. I'm thinking an extension of CI_Controller or CI_Model, for instance. includebeer Wrote:In my models I also have functions that do other stuff than database operations. Like data validation, for example. Stuff related to the database model.OK this is interesting. I might have been inclined to create a validation library, seeing as how it seems very 'library-like' in my vague reckoning of these things. I feel I should mention that when I've done a validation tool in the past, it was a class with all static methods so instantiating it would be pointless. My autoloader is making me much calmer about this. Seems like models then are predominantly database-related, but with other possibly tangential stuff? I'm imagining classes of greater complexity that build on the basic db classes via Object Composition or Function Composition. I can't help but wonder about things like email functionality, payment gateway classes, etc. These seem like libraries to me but what do I know. Maybe payment gateway classes belong in third_party? Still not sure what helpers are. Will check the reading. Thanks for your response. |
Welcome Guest, Not a member yet? Register Sign In |