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
Helpful Constants
Trongate defines a few constants that are genuinely useful in day-to-day development. These constants are available everywhere - controllers, models, views and helpers.
No configuration needed. Just use them:
APPPATHabsolute path to app directoryBASE_URLyour site's root URLREQUEST_TYPEHTTP method (GET, POST, etc.)
File Paths
The APPPATH constant returns the absolute file system path to your application directory.
Use it for building file paths:
In view files, use PHP short tags:
Base URL
The BASE_URL constant returns your site's root URL as defined in config/config.php.
Use it when you need to build URLs manually:
When using redirect() or anchor(), pass relative URLs without BASE_URL. Both functions prepend it automatically.
Request Type
The REQUEST_TYPE constant contains the HTTP method for the current request.
Common values: GET, POST, PUT, DELETE, PATCH
Trongate defines additional constants for routing and internal configuration, but those described above are the ones you're likely to actually use in your day-to-day development work.