Introduction
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
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:
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:
It Totally Works!
\n\n Congratulations! You have successfully installed Trongate. This is your homepage. Trongate was built with a focus on lightning-fast performance, while minimizing dependencies on third-party libraries. By adopting this approach, Trongate delivers not only exceptional speed but also rock-solid stability.\n
\n\n You can change this page and start adding new content through the admin panel.\n
\nGetting Started
\n\n To get started, log into the admin panel. From the admin panel, you\'ll be able to easily edit this page or create entirely new pages. The default login credentials for the admin panel are as follows:\n
\n- \n
- Username: admin \n
- Password: admin \n
About Trongate
\n\n Trongate is an open source project, written in PHP. The GitHub repository for Trongate is here. Contributions are welcome! If you\'re interested in learning how to build custom web applications with Trongate, a good place to start is The Learning Zone. The URL for the Learning Zone is: https://trongate.io/learning-zone. If you enjoy working with Trongate, all we ask is that you give Trongate a star on GitHub. It really helps!\n
\n\n Finally, if you run into any issues or you require technical assistance, please do visit our free Help Bar, which is at: https://trongate.io/help_bar.\n
\nThis 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.