---
title: "Modules Plugin"
url: https://festi.dev/8.0/Plugins/Modules/
---

# 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:
```php
$this->plugin->mail->send(...);
Core::getInstance()->getPluginInstance('Mail')->method(...);
```

To get a Module instance (class name without `Plugin` suffix, case-sensitive):
```php
/** @var TestModulePlugin $plugin */
$plugin = ModulesManager::getInstance()->getModule('TestModule');
assert($plugin instanceof TestModulePlugin);
```

## Table of Contents

- [Creating a Module](https://festi.dev/8.0/Plugins/Modules/docs/CreatingModule/index.md) — interfaces, lifecycle methods, SQL migration, menu items
- [Module Options](https://festi.dev/8.0/Plugins/Modules/docs/ModuleOptions/index.md) — static options via SQL, dynamic field options at runtime
- [Observer Endpoints](https://festi.dev/8.0/Plugins/Modules/docs/ObserverEndpoints/index.md) — cross-module event dispatch and subscription
- [Store Events](https://festi.dev/8.0/Plugins/Modules/docs/StoreEvents/index.md) — store lifecycle hooks (before update, workspace provider, store init)
- [Upgrade Plugin to Module](https://festi.dev/8.0/Plugins/Modules/docs/UpgradePluginToModule/index.md) — step-by-step migration guide
