class Route

Methods

__construct(Route $base, Collection $paramDefaults, string|null $forcedScheme)

Create a new Wayfinder route wrapper.

bool
hasController()

Determine whether the route resolves to a controller class.

string
dotNamespace()

Return the controller's fully qualified class name as a dot-delimited namespace.

bool
hasInvokableController()

Determine whether the controller is invokable (single __invoke method).

string
method()

Return the PHP method name on the controller for this route.

string
jsMethod()

Return the TypeScript-safe method name for the generated export.

string
originalJsMethod()

Return the unmodified method name as it appears on the controller.

string
namedMethod()

Return the TypeScript-safe method name derived from the route's name.

string
controller()

Return the controller class with a leading namespace separator.

parameters()

Return the Wayfinder Parameter objects describing each route parameter.

verbs()

Return the HTTP verbs this route responds to.

string
uri()

Build the URI template used in the generated TypeScript output.

string|null
scheme()

Return the URL scheme that should prefix this route's URI (including '://').

string|null
domain()

Return the route's domain (including any port).

string|null
name()

Return the route's name, normalising namespaced names for the generator.

string
controllerPath()

Return a project-relative path to the controller (or closure) file.

int
controllerMethodLineNumber()

Return the starting line number of the controller method (or closure).

Details

at line 25
__construct(Route $base, Collection $paramDefaults, string|null $forcedScheme)

Create a new Wayfinder route wrapper.

Parameters

Route $base
Collection $paramDefaults
string|null $forcedScheme

at line 35
bool hasController()

Determine whether the route resolves to a controller class.

Return Value

bool

at line 43
string dotNamespace()

Return the controller's fully qualified class name as a dot-delimited namespace.

Return Value

string

at line 51
bool hasInvokableController()

Determine whether the controller is invokable (single __invoke method).

Return Value

bool

at line 59
string method()

Return the PHP method name on the controller for this route.

Return Value

string

at line 69
string jsMethod()

Return the TypeScript-safe method name for the generated export.

Return Value

string

at line 77
string originalJsMethod()

Return the unmodified method name as it appears on the controller.

Return Value

string

at line 87
string namedMethod()

Return the TypeScript-safe method name derived from the route's name.

Return Value

string

at line 95
string controller()

Return the controller class with a leading namespace separator.

Return Value

string

at line 107
Collection parameters()

Return the Wayfinder Parameter objects describing each route parameter.

Return Value

Collection

at line 127
Collection verbs()

Return the HTTP verbs this route responds to.

Return Value

Collection

at line 135
string uri()

Build the URI template used in the generated TypeScript output.

Return Value

string

at line 163
string|null scheme()

Return the URL scheme that should prefix this route's URI (including '://').

Return Value

string|null

at line 179
string|null domain()

Return the route's domain (including any port).

Return Value

string|null

at line 191
string|null name()

Return the route's name, normalising namespaced names for the generator.

Return Value

string|null

at line 209
string controllerPath()

Return a project-relative path to the controller (or closure) file.

Return Value

string

at line 233
int controllerMethodLineNumber()

Return the starting line number of the controller method (or closure).

Return Value

int