Introduction
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
Authorization & Authentication
View Files
With Trongate, views are just PHP files. That’s it.
HTML + <?= $var ?> = dynamic page.
No template engine. No learning curve. Just PHP.
Where They Live
Each module can have one views directory. Put your view files in it. Done.
The text above demonstrates some file and directory locations for a hypothetical 'users' module.
How to Load One
View files can be loaded from any controller by using Trongate's view() method:
Trongate renders views/users_list.php. That’s it.
Passing Data
In the view:
Return as String (Pro Move)
Need HTML as a variable?
Third arg = true → returns a string. No output. You control it.
Never put logic in views.
if, foreach = OK.
Queries, auth, redirects = NO. That’s controller/model territory.
Use Trongate’s out() string helper to automatically escape user-generated content, protect your site from XSS and ensure proper encoding.
Remember, when you're dealing with Trongate, PHP is the template engine.
100% Native PHP. 100% nailed.