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
Helpers Overview
Helpers are single-file collections of pure PHP functions. No classes. No namespaces. No autoloading drama. Just drop-dead simple functions you can call anywhere.
They live in engine/tg_helpers/ and get loaded automatically on every request. Zero effort required.
Trongate's Helper Files
Five files. Zero dependencies.
- Flashdata Helpers ← one-time session messages
- Form Helpers ← building forms without tears
- String Helpers ← text surgery & sanitization
- URL Helpers ← links, redirects, segments and more
- Utilities Helpers ← everything else you need
How to Use Them
Just call the functions. Anywhere. Anytime.
Example #1
Here's an example of how to redirect a user to a login page, using Trongate's redirect() helper:
Example #2
The code below demonstrates how to using Trongate's form_button() helper. This kind of code would typically be written inside a view file:
Why Helpers Beat "Modern" Alternatives
- No includes. No config. No drama.
- No Composer = runs forever
- No classes = no instantiation overhead
- No namespaces = no
usestatements - No service containers = no brain damage
For a technical, no-bs breakdown of everything that's included with Trongate's helpers, check out the Helpers Reference Guide.
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.