Modules Plugin

The Modules Plugin provides a robust, extendable architecture for managing business logic in a scalable and modular way. It enables developers to define core logic as Plugins and extend it using independent Modules.

Core Concepts

  • Plugin — a system-level component that describes direct business logic. Plugins can depend on each other because all of them are guaranteed to exist in the system.
  • Module — an extendable component that extends a Plugin's logic or creates new logic on top of existing plugins. Modules can depend on plugins, but cannot depend on other modules.

To get a Plugin instance:

$this->plugin->mail->send(...);
Core::getInstance()->getPluginInstance('Mail')->method(...);

To get a Module instance (class name without Plugin suffix, case-sensitive):

/** @var TestModulePlugin $plugin */
$plugin = ModulesManager::getInstance()->getModule('TestModule');
assert($plugin instanceof TestModulePlugin);

Table of Contents