I am very new to ExpressionEngine and don't quite fully understand all the concepts yet as I come from a solid OOP environment. When would you use functions in modules and when would you use functions in Extensions?
1 Answer
Extensions are used when you want to take over, modify, or perform extra routines when native first-party methods are executed. For example, performing extra actions after an entry is saved.
Modules (and Plugins to an extent) are used when you want to make functionality (and therefore output) available in Templates via tags. Things that need to occur in a template, or add functionality that is explicitly outside of ExpressionEngine's native feature set.
You can find an overview of the different types of add-ons for ExpressionEngine (including Extensions, Modules, Plugins, Fieldtypes, and more) as well as some sample code and walkthroughs in the Add-on Development section of the User Guide.
-
1Also note that many third-party add-ons also have their own extension hooks which can be used to extend their functionality via custom extensions as well. Jun 3, 2014 at 12:12