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
Homepage Routing
Every other PHP framework makes you do an elaborate tap dance routine for your homepage.
Trongate? Two constants. Refresh. Done.
First: Lock Down Your BASE_URL
Open config/config.php and make sure this line is correct:
Key Rules:
- Replace
https://yoursite.com/with your actual website address. - Make sure your
BASE_URLends with a forwardslash.
Now Control Your Homepage
On config.php, you’ll see these two bad boys:
Set them!
Key Rules:
DEFAULT_MODULE- the name of the module that loads when someone visits your homepage.DEFAULT_METHOD- the method that runs, by default, inside the controller file for that module.
Set them. Set them now. Then, visit your homepage and feel the power.
Wanna Change It? Cool!
Would you like your homepage to load a dashboard instead? Two lines:
Now https://yoursite.com → dashboard/Dashboard.php->home()
Boom! Homepage conquered.
| Module Name | Controller File | Class Name |
|---|---|---|
welcome | Welcome.php | class Welcome |
dashboard | Dashboard.php | class Dashboard |
user_admin | User_admin.php | class User_admin |
Attention v1 Veterans:
In v1 you had to declare a DEFAULT_CONTROLLER like a good little soldier.
For Trongate v2 we quietly retired it with full honors. That means less typing for you and less stuff to learn.
You’re welcome!
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.