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.

Overview of Primary Directories

The Trongate Framework is a structured collection of directories and files designed to streamline the web development process. Below is a concise summary of each directory's purpose.

The contents of a basic Trongate web application
The contents of a basic Trongate Web Application.

The Engine Directory

The engine directory contains the core functionality of the Trongate framework, including files responsible for loading classes, handling routes, and providing helper functions. Modifying files within this directory is strongly discouraged unless absolutely necessary and fully understood.

The Config Directory

The config directory stores essential configuration settings for your application, such as the base URL, environment settings, and default controllers. These settings are globally accessible throughout the application.

Never deploy a Trongate web application with the "ENV" setting configured to "dev".

The Modules Directory

The modules directory organizes distinct components of the Trongate application, each referred to as a module. Modules encapsulate all functionality required for a specific feature, making them self-contained and reusable. Typically, a Trongate module includes the following subdirectories:

  • Controllers: Handle the business logic of the module.
  • Views: Manage the presentation layer and user interface elements.
  • Assets: Store related files such as CSS, JavaScript, and images.

The Templates Directory

The templates directory is used for storing HTML templates. Unlike other frameworks that rely on separate templating engines, Trongate leverages PHP itself as its templating engine. This approach simplifies the learning curve and enhances performance.

The Public Directory

The public directory serves as the primary entry point for a Trongate web application, containing the index.php file. It also houses assets such as CSS, JavaScript, and images that are directly served to clients. Entire HTML themes can also be stored within the public directory.

The public and engine directories contain essential license files. These files include specific framework version details and are critical for managing updates via the Trongate Desktop App. Modifying or removing these files may disrupt the update process and should be avoided to maintain system integrity.

×