The Trongate PHP Framework
Documentation
Introduction
Quick Start
Basic Concepts
Understanding Routing
Controllers
Views
Assets
Modules Calling Modules
Parent & Child Modules
Database Operations
Modules within Modules
Templates & Themes
Helpers Explained
Form Handling
Working with Files
The Module Import Wizard
Authorization & Authentication
The API Explorer
Best Practices

Help Improve Our Docs

If you’ve found an error, spotted something missing, or feel a section could be clearer or better explained, we’d love to hear from you. Your feedback helps keep the documentation accurate and useful for everyone.

Please report issues or suggest improvements on GitHub. Community input is invaluable in making the docs stronger.

Not comfortable with GitHub? No problem — you can also get in touch with us directly via our contact form. We welcome all feedback.

Installing Trongate Using GitHub

The Trongate PHP framework is available from GitHub at the following URL:

https://github.com/trongate/trongate-framework.

However, the fastest and easiest way to obtain Trongate is by using the Trongate Desktop App. This Electron-based application, built with Node.js, is completely free and always will be. It is available for Mac, Windows, and Linux and can be downloaded from:

https://trongate.io/download.

Why Use the Trongate Desktop App?

The Trongate Desktop App provides several benefits, including:

  • Automatic framework downloads and setup
  • Automatic updates when new features are released
  • Automatic code generation
  • Built-in database management
  • A graphical query builder

...and much more!

Installing Without the Desktop App

For those who prefer not to use the Desktop App, Trongate can still be installed manually.

Configuring the Main Settings File

To begin, the primary configuration file, config.php, must be set up correctly. This file is located at:

The contents of config.php are as follows:

The most critical setting at this stage is the BASE_URL constant.

What is a Base URL?

The Base URL (BASE_URL) represents the root address of a website. For example, if the site is hosted at http://www.example.com/, the BASE_URL should be set as follows:

Always make sure the value that is assigned to BASE_URL ends with a forwardslash.

Ensuring that the base URL is correctly defined is essential for loading assets such as images and stylesheets and for proper navigation throughout the application.

After setting the BASE_URL, save the config.php file.

Note: All constants defined in the config directory can be accessed from both controller and view files. For example, the following code outputs the application's base URL:

Setting Up the Database

Users installing Trongate manually must create and configure a database.

Step 1: The Database Configuration File

Once a database has been created (using a database management tool such as PHPMyAdmin), the database configuration file (database.php) must be updated. This file is located at:

The setup.sql file can be imported into the database management software to create the required tables. Alternatively, the SQL statements from setup.sql can be executed manually.

The content of setup.sql is as follows:

This code should be executed, either by importing setup.sql or by copying and pasting the code above from within your database management software.

Once the database setup is complete, delete the setup.sql file to enhance security.

×