TradeBench 1.0.0
Algorithmic Trading Backtesting Platform
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes
App\Core\Router Class Reference

Simple HTTP Router implementing the Front Controller pattern for MVC architecture. More...

Public Member Functions

 add (string $method, string $path, array $handler)
 Registers a new route in the application.
 
 dispatch (string $method, string $uri)
 Matches the incoming request to a registered route and dispatches it.
 

Private Attributes

array $routes = []
 

Detailed Description

Simple HTTP Router implementing the Front Controller pattern for MVC architecture.

Member Function Documentation

◆ add()

App\Core\Router::add ( string $method,
string $path,
array $handler )

Registers a new route in the application.

Parameters
string$methodThe HTTP method (GET, POST, DELETE, etc.).
string$pathThe URL endpoint (supports regex tokens like {id}).
array$handlerCallable array referencing [Controller::class, 'methodName'].

◆ dispatch()

App\Core\Router::dispatch ( string $method,
string $uri )

Matches the incoming request to a registered route and dispatches it.

Parameters
string$methodThe requested HTTP method.
string$uriThe requested URI path.

Field Documentation

◆ $routes

array App\Core\Router::$routes = []
private

The documentation for this class was generated from the following file: