RouteDefinition
in package
Data class representing a route definition discovered via attributes.
This class holds all the information needed to register a route with the Router.
Table of Contents
Properties
- $action : string
- $controller : string
- $filters : array<string|int, mixed>
- $method : string
- $name : string|null
- $path : string
Methods
- __construct() : mixed
- getControllerMethod() : string
- Get the controller method in the format expected by Router
Properties
$action read-only
public
string
$action
$controller read-only
public
string
$controller
$filters read-only
public
array<string|int, mixed>
$filters
= []
$method read-only
public
string
$method
$name read-only
public
string|null
$name
= null
$path read-only
public
string
$path
Methods
__construct()
public
__construct(string $path, string $method, string $controller, string $action[, string|null $name = null ][, array<string|int, mixed> $filters = [] ]) : mixed
Parameters
- $path : string
-
Route path (e.g., '/users/:id')
- $method : string
-
HTTP method (GET, POST, PUT, DELETE)
- $controller : string
-
Controller class name
- $action : string
-
Controller method name
- $name : string|null = null
-
Optional route name
- $filters : array<string|int, mixed> = []
-
Array of filter names
getControllerMethod()
Get the controller method in the format expected by Router
public
getControllerMethod() : string
Return values
string —Format: "ClassName@methodName"