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

Interceptors

Trongate v2 introduces a new feature to rule every request - before routing, before controllers, before anything.

Meet INTERCEPTORS.

This page contains instructions on how to build an "Endpoint Listener" module that records inbound HTTP requests. You can download the complete Endpoint Listener module from the Module Market.

Check It Out


How It Works

In your main config file, you can define some code to be invoked whenever your application receives inbound HTTP requests.

That's it. There's nothing else!

The rest of this page just walks you through an example.


Step 1: Turn It On

Open config/config.php. Add:

Now Endpoint_listener::record() runs on every request.


Step 2: Build the Listener

Create


Step 3: Create the Table

Run once:


Congratulations!

  • Every request → captured
  • Runs before routing
  • Zero bloat. Zero config.
  • Dev-only by default