Trongate Docs
switch to dark modeswitch to dark mode
What's Inside A Module?

What's Inside A Module?

A Trongate module typically contains the following three folders (i.e., subdirectories):

  • controllers
  • views
  • assets
  • the basic structure of a Trongate module

    The Controllers Folder

    The controllers folder is for business logic.  You can think of the controllers folder as being the brains of your module.  Usually, the controllers folder will contain one PHP file with the entirety of the file being made up of a PHP class.  There is a hypothetical scenario where a controllers folder could contain more than one PHP file, however this type of situation is rare.

    The Views Folder

    The views folder is for storing presentational content.  This usually means HTML code. Since PHP can be integrated seamlessly with HTML, the files that get stored inside the views folder will always be PHP files.  However, the files here will be mostly made up of HTML code and not business logic.

    The Assets Folder

    The assets folder is for storing additional files that the module requires.  The assets folder can be used for storing things like; CSS, JavaScript, Pictures, API Endpoint settings (more about that later!) and more.


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