Introduction
Basic Concepts
Understanding Routing
Intercepting Requests
Module Fundamentals
Database Operations
Templates
Helpers
Form Handling
- Form Handling Fundamentals
- Creating Forms
- Form Input Fields
- Textareas and Dropdowns
- Checkboxes and Radio Buttons
- Form Labels
- Retrieving Form Data
- Form Validation Basics
- Displaying Validation Errors
- The Create/Update Pattern
- CSRF Protection
- Custom Validation Rules
- Form Helper Reference
- Validation Rules Quick Reference
- Best Practices For Handling Data
Working With Files
Image Manipulation
Working With Dates & Times
Authorization & Authentication
Modular MVC
The core of every Trongate application is the modules directory. Each module is self-contained, independent, and built with Native PHP - no Composer, no PSR-4 autoloaders, no hidden bloat.
Modules: The Only Part of Your App That Matters
Everything else is plumbing.
Your actual app? It lives in modules/. One folder per feature. Done.
Here's an example of a real-world Trongate module:
modules/
users/
Users.php ← the boss
Users_model.php ← only if you're fancy
views/ ← pure PHP, no template engine
css/
js/
images/
child_modules/ ← nest child modules if you must
Key Characteristics
- One controller file per module. Required.
- One model file per module. Optional.
- A
views/folder. Optional. - CSS, JS, images? Throw them in too, if you want. Optional.
- Child modules inside modules? Yes. Nesting allowed.
The Benefits of Modular MVC
- Copy → paste → works. No setup. No config. No faffing about.
- Don't like models? Fine. Write 50 lines in the controller. We don’t judge.
- Need models? Cool. Keep your controller skinny. We respect that too.
- Assets live with the code that uses them.
No more hunting through massive and confusing paths, such as:public/assets/js/admin/users/whoops/wrong-folder.
Trongate modules are 100% portable.
Steal one from your last project. Drop it in. Refresh. Boom!
How Trongate Modules Destroy “Traditional” MVC
| Other frameworks | Trongate |
|---|---|
| Modules need registration, routes, service providers | Drop folder. Done. |
| Assets scattered across 17 directories | Everything lives together. Like family. |
| Can’t reuse without Composer + config hell | Copy. Paste. Enjoy. |
| “Where’s my login module?” → 45-minute treasure hunt | modules/users/ → oh look, it’s right there. |