\LiftKit\Router\RouteRoute

Route

Basic route class. All routes have two responsibilities:

  • Determine whether the route matches a Request
  • Do something if it does match, using the Request to determine what

Summary

Methods
Properties
Constants
__construct()
isValid()
execute()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

__construct()

__construct(callable  $condition, callable  $callback) 

Constructor

Parameters

callable $condition

Callback that takes a Request as a parameter and returns a boolean indicating whether the Route matches

callable $callback

Callback that represents the action to be taken if the route matches, takes a Request as a parameter

isValid()

isValid(\LiftKit\Request\Request  $request) : boolean

Returns whether the route matches the supplied request

Parameters

\LiftKit\Request\Request $request

Returns

boolean