Trongate Docs
switch to dark modeswitch to dark mode
»
»
The Structure of a Trongate Web App

The Structure of a Trongate Web App

The Trongate Framework – like any PHP framework – is essentially a collection of folders and files that have been created to make your life easier. There now follows a summary of what each of the folders is for.

the contents of a basic Trongate web app

Just To Let You Know
Both the 'public' folder and the 'engine' folder contain license files.  These license files serve a very important purpose.  Whenever framework updates are made available, the desktop app reads the license files to ascertain what version of Trongate you're using.  By having this facility, Trongate developers can have framework updates added (optionally, of course!) at the click of a button.  It's therefore very important not to tamper with or move the license files.

The Engine Folder

The ‘engine’ folder contains the main workings of the Trongate framework. This includes all of the files for loading classes and handling routes, as well as all of the helpers that come with the Trongate Framework. 

Please avoid changing any files within the engine folder – unless you really know what you’re doing.

The Config Folder

The ‘config’ folder is where you store settings to do with your application. The most important file within this folder is the config.php file. This is where you would declare things like your website base URL, your environment, your default controllers and more. The values that you set in your config folder are available throughout your entire application.

WARNING!
Never launch a Trongate web app with the environment value ("ENV") set to "dev".

The Modules Folder

The 'modules' folder is where you would store your modules.  Modules are self-contained folders that contain assets that have been designed to carry out certain tasks.  For example, if you were building an invoicing system, you may decide to create a module called 'invoices'.  All of the code that relates to the generation and management of invoices could potentially be contained within your 'invoices' module.

Modules (in Trongate) typically contain:

  • a 'controllers' folder
  • a 'views' folder
  • an 'assets' folder

With Trongate, modules can be easily copied from one app to another.  They can even contain other modules - but let's not get ahead of ourselves!   

The Templates Folder

The 'templates' folder is where you store your HTML templates.  Please note that the Trongate Framework does not have a templating engine.  That's because PHP is a templating engine.  So, that's one more thing that you don’t have to learn and it's also another factor that makes Trongate faster than other PHP frameworks.

The Public Folder

The 'public' folder contains the main entry point for your Trongate web application - namely, a PHP file named 'index.php'.  Normally, developers like to use the public folder to store things like CSS files, JavaScript files, images and things of that nature.



HELP & SUPPORT

If you have a question or a comment relating to anything you've see here, please goto the Help Bar.

 
×