(12-28-2014, 08:12 PM)ivantcholakov Wrote: Models contain business logic in the generic sense. Some people see them only interacting with the database, well, its a narrow interpretation. If you think that a piece of code belongs to a model, move it there.
OK this is a bit of a relief to hear I suppose, but makes me wonder what the libraries folder is really for. I'm would imagine that a Paypal library or Authorize.net library might go in there but I've also heard talk about a third_party directory which seems even more appropriate.
(12-28-2014, 08:12 PM)ivantcholakov Wrote: About the emails: Sending emails from models is not a problem. It would be nice emails to be driven by an Event system, but CodeIgniter alone does not have such.
I expect it might be necessary to send email from almost any where: controllers, libraries, models. In many cases, I send an email to our developers when an uncaught exception is encountered. Because our system is hosted on a dynamically-allocated cloud computer, we must use SendGrid to get our mail reliably delivered (Rackspace and Amazon compute instances tend to be on a mail banlist by default and so are incapable of sending mail directly). Obviously I want to route all of my mail through a single mail class/object/function. The question that arises is
where does this thing live?