6 How to create a module
C. Fahner edited this page 2026-04-25 20:00:40 +02:00

How to create a Slendium module

Creating a module is as easy as creating a new PHP namespace. Adding a new module to your project is simply a matter of adding the code and enabling it in your configuration file.

Directory structure

Every module lives in its own PHP namespace, but there are some reserved names inside that namespace. Generally a module has the following structure:

MyModule/
├─ MyModule.php
├─ Assets/
│   ├─ Icons/
│   ├─ Strings/
├─ Commands/
├─ Common/
├─ Components/
├─ Emittables/
├─ Listeners/
├─ Resources/
├─ Services/
├─ Templates/
├─ Upgrades/