Trongate PHP Framework Docs
Introduction
Basic Concepts
Understanding Routing
Intercepting Requests
Module Fundamentals
Database Operations
Templates
Helpers
Form Handling
Working With Files
Image Manipulation
Working With Dates & Times
Authorization & Authentication
Tips And Best Practices

Loading Modules

Two ways. Zero drama.

Modules can be loaded from the URL or from code. No service containers. No CLI tools. No PSR autoloaders. Just Native PHP.

1. From the URL (the easy way)

Go to:

Trongate runs:

Important Trongate v2 Change!

URL segments are no longer automatically passed as method parameters. This improves security and performance.

Use the function to explicitly fetch URL parameters when you need them.

2. From Code (the fun way)

Inside any controller:

Inside any view:

Attention Trongate v1 veterans!!!

$this->module('tax') is dead. We murdered it in v2. There's no longer any need to write that.

You're very welcome.

Passing Data? Pass ANYTHING.

The second parameter of Modules::run() accepts ANY PHP data type:

  • Arrays - Pass complex datasets
  • Integers/Floats - Pass numeric values
  • Strings - Pass text content
  • Booleans - Pass true/false flags
  • Objects - Pass complete objects
  • Resources - Pass file handles, database connections
  • NULL - Pass nothing explicitly

One parameter. Every data type. Unlimited possibilities.

EXAMPLES

Example 1: Pass a simple string

Example 2: Pass an integer ID

Example 3: Pass a boolean flag

Example 4: Pass a complex array

Example 5: Pass an object

Example 6: Pass NULL (explicitly pass nothing)

Inside your module method: