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

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:

  • APPPATH absolute path to app directory
  • BASE_URL your site's root URL
  • REQUEST_TYPE HTTP 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 or , 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.

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