com\setasign\SetaFramework\Router\Route
Callback Class Route Callback
File: /SetaFramework/src/Router/Route/Callback.php
Class hierarchy
Implements
- \Psr\Log\LoggerAwareInterface
- RouteInterface
Summary
Properties
$defaultValues
protected array<string, mixed> Callback::$defaultValues
Methods
__construct()
public Callback::__construct (
callable $callback,
array<string, mixed> $defaultValues = array ( )
)array<string, mixed> $defaultValues = array ( )
This route is for testing purposes. If you use the same callback over and over again you should create a new route.
$callback has the Request-object as param. The callback need to return an array or false. Everything what isn't an array will result a non-matching route.
Parameters
- $callback : callable
- $defaultValues : array<string, mixed>
setDefaultValue()
Sets a key of the defaultValues array
Parameters
- $key : string
The key shouldn't be a natural number
- $value : mixed
setDefaultValues()
Overwrites the defaultValues array
Parameters
- $defaultValues : array<string, mixed>
The keys of this array shouldn't be natural numbers
