Neuron-PHP

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

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"


        
On this page

Search results