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
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:
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.
Passing Data? 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)