Application Flow


    CodeExtinguisher's logic starts when a request is made to CodexController. A request (by default) is one of: add, edit, delete. First, CE calls the "pre" hook on all the plugins of that specific table. So before an addition, the preInsertHook get called, before an edit, the preEditHook get called, and so on. Then the prepForDb (or prepForDisplay) callback gets called on each plugin, which formats the data for the db or the display. For example. When prepForDisplay gets called on a Date plugin with the selected date in YYYY-MM-DD format, it returns a nicely formatted date string such as April 16, 2008. Finally, the "post" hook gets called on each plugin (postInsertHook or postEditHook). When you write your own plugins, these hooks and callbacks are invaluable as they allow you to handle your data in highly specialized ways.