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()

Return the URI template used in the generated TypeScript output.

string
verbPrefixedUri()

Return the URI template prefixed with the route's verbs, for keying routes that share a URI.

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|null
originalName()

Return the route's unmodified name.

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 40
__construct(Route $base, Collection $paramDefaults, string|null $forcedScheme)

Create a new Wayfinder route wrapper.

Parameters

Route $base
Collection $paramDefaults
string|null $forcedScheme

at line 51
bool hasController()

Determine whether the route resolves to a controller class.

Return Value

bool

at line 59
string dotNamespace()

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

Return Value

string

at line 67
bool hasInvokableController()

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

Return Value

bool

at line 75
string method()

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

Return Value

string

at line 85
string jsMethod()

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

Return Value

string

at line 93
string originalJsMethod()

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

Return Value

string

at line 103
string namedMethod()

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

Return Value

string

at line 111
string controller()

Return the controller class with a leading namespace separator.

Return Value

string

at line 123
Collection parameters()

Return the Wayfinder Parameter objects describing each route parameter.

Return Value

Collection

at line 190
Collection verbs()

Return the HTTP verbs this route responds to.

Return Value

Collection

at line 198
string uri()

Return the URI template used in the generated TypeScript output.

Return Value

string

at line 206
string verbPrefixedUri()

Return the URI template prefixed with the route's verbs, for keying routes that share a URI.

Return Value

string

at line 214
string|null scheme()

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

Return Value

string|null

at line 230
string|null domain()

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

Return Value

string|null

at line 242
string|null name()

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

Return Value

string|null

at line 260
string|null originalName()

Return the route's unmodified name.

Return Value

string|null

at line 268
string controllerPath()

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

Return Value

string

at line 292
int controllerMethodLineNumber()

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

Return Value

int