Introduction
Basic Concepts
Understanding Routing
Controllers
Views
Assets
Modules Calling Modules
Parent & Child Modules
Database Operations
Modules within Modules
Templates & Themes
Helpers Explained
Form Handling
Working with Files
The Module Import Wizard
Authorization & Authentication
The API Explorer
If you’ve found an error, spotted something missing, or feel a section could be clearer or better explained, we’d love to hear from you. Your feedback helps keep the documentation accurate and useful for everyone.
Please report issues or suggest improvements on GitHub. Community input is invaluable in making the docs stronger.
Not comfortable with GitHub? No problem — you can also get in touch with us directly via our contact form. We welcome all feedback.
The Anatomy of a Trongate Module
A Trongate module is typically organized into three primary directories, each serving a distinct purpose:
- Controllers: This directory contains the business logic of the module. It typically includes one or more PHP files, with at least one file defining a PHP class. While most modules contain a single PHP class file, some may require multiple files depending on complexity.
- Views: The views directory houses presentational content, primarily HTML. These PHP files are designed to integrate seamlessly with HTML, focusing on the user interface rather than business logic. This directory is optional, as not all modules produce presentational output.
- Assets: This directory stores additional resources such as CSS, JavaScript, images, and configuration files for API endpoints. Like the views directory, this is optional and only included when necessary.

What About the 'Models' Directory?
To facilitate secure and efficient database interactions, all Trongate modules can utilize a centralized 'Model' PHP class. This class resides within the Trongate framework's 'engine' directory, rather than within individual modules. Centralizing the model simplifies maintenance, enhances security, and ensures consistent database interactions across all modules.
For more information regarding Trongate's Model class, please refer to the Database Operations chapter.