Trongate PHP Framework Docs
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
Tips And Best Practices

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:

  1. Replace https://yoursite.com/ with your actual website address.
  2. Make sure your BASE_URL ends with a forwardslash.

Now Control Your Homepage

On config.php, you’ll see these two bad boys:

Set them!

Key Rules:

  1. DEFAULT_MODULE - the name of the module that loads when someone visits your homepage.
  2. 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.comdashboard/Dashboard.php->home()

Boom! Homepage conquered.

Module Name Controller File Class Name
welcomeWelcome.phpclass Welcome
dashboardDashboard.phpclass Dashboard
user_adminUser_admin.phpclass 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.

Leave Feedback About This Page