This chapter explains plugins and modules, including those that we have used in our application. This chapter also covers events and plugin conﬁguration.
Plugins are PHP code blocks in MODx that, unlike snippets, are not called for execution from a resource or a template. Rather, plugins are executed on the triggering of certain events, when a resource is parsed, or during other internal processing. Every action in MODx, such as rendering a resource, or deleting a user from the system, will trigger a series of flags. Each flag is viewed as an event. For example, you have events such as:
OnDocFormPrerender—triggered just before the resource is going to be rendered
OnUserFormSave—triggered just before ...