Welcome Guest, Not a member yet? Register   Sign In
Avoiding massive controller: where to put individual files
#12

In more abstract level I think about the libraries as models first. They are for "M" in most of the cases. The differeces are technical.

For sending emails I have adapted code from an old PyroCMS release some time ago. Here is what I've got: https://github.com/ivantcholakov/starter...ules/email
Look at this first: https://github.com/ivantcholakov/starter...events.php

I demonstrate usage for a contact page. For more use-cases you may download and old purely CodeIgniter-based PyroCMS and see what is inside.

The good thing is that later you can attach more handlers to the 'email' event (for sending notification SMS for example), without need for code modification in many places.

Here is the Event library I use (not maintained by the initial author): https://github.com/ericbarnes/CodeIgniter-Events

I still need to support PHP 5.2 this is why I stay old-fashioned. I see that Lonnie Ezell makes something about emails and events https://github.com/ci-bonfire/Sprint/blo...l/email.md , https://github.com/ci-bonfire/Sprint/blo.../events.md , but I don't have the time to watch there.
Reply


Messages In This Thread
RE: Avoiding massive controller: where to put individual files - by ivantcholakov - 12-28-2014, 10:15 PM



Theme © iAndrew 2016 - Forum software by © MyBB