Introduction
Quick Start
Basic Concepts
Understanding Routing
Intercepting Requests
Module Fundamentals
Database Operations
Templates
Helpers
Form Handling
Form Validation
Working With Files
Image Manipulation
Working With Dates & Times
Language Control
Security
Loading Modules
Two ways. Zero drama.
Modules can be loaded from the URL or from code. No service containers. No CLI tools. No PSR autoloaders. Just Native PHP.
1. From the URL (the easy way)
Go to:
Trongate runs:
Important Trongate v2 Change!
URL segments are no longer automatically passed as method parameters. This improves security and performance.
Use the segment() function to explicitly fetch URL parameters when you need them.
2. From Code (the fun way)
Inside any controller:
Inside any view, use class_reference-the_modules_class-run():
Attention Trongate v1 veterans!!!
$this->module('tax') is dead. We murdered it in v2. There's no longer any need to write that.
You're very welcome.
class_reference-the_modules_class-run() — Pass ANYTHING.
The second parameter of Modules::run() accepts ANY PHP data type:
- Arrays - Pass complex datasets
- Integers/Floats - Pass numeric values
- Strings - Pass text content
- Booleans - Pass true/false flags
- Objects - Pass complete objects
- Resources - Pass file handles, database connections
- NULL - Pass nothing explicitly
One parameter. Every data type. Unlimited possibilities.
EXAMPLES
Example 1: Pass a simple string
Example 2: Pass an integer ID
Example 3: Pass a boolean flag
Example 4: Pass a complex array
Example 5: Pass an object
Example 6: Pass NULL (explicitly pass nothing)
Inside your module method:
We're continually improving the Trongate documentation. If anything is incorrect, unclear, incomplete, or could be better, we'd genuinely appreciate your input.
Share your thoughts in the Documentation Feedback.