Documentation

ApiRoutableInterface
in

Interface for API handlers that participate in route dispatch.

Handlers implementing this interface can be dispatched by ApiV1's route map. Each method receives the parsed URL fragments and request parameters, and returns a JsonResponse.

Not all handlers need all methods — the default should return 405.

Tags
since
3.0.0

Table of Contents

Methods

routeDelete()  : JsonResponse
Handle a DELETE request for this resource.
routeGet()  : JsonResponse
Handle a GET request for this resource.
routePost()  : JsonResponse
Handle a POST request for this resource.
routePut()  : JsonResponse
Handle a PUT request for this resource.

Methods

routeDelete()

Handle a DELETE request for this resource.

public routeDelete(array<int, string> $fragments, array<string, mixed> $params) : JsonResponse
Parameters
$fragments : array<int, string>

URL path segments (resource name already consumed)

$params : array<string, mixed>

Query/body parameters

Return values
JsonResponse

routeGet()

Handle a GET request for this resource.

public routeGet(array<int, string> $fragments, array<string, mixed> $params) : JsonResponse
Parameters
$fragments : array<int, string>

URL path segments (resource name already consumed)

$params : array<string, mixed>

Query parameters

Return values
JsonResponse

routePost()

Handle a POST request for this resource.

public routePost(array<int, string> $fragments, array<string, mixed> $params) : JsonResponse
Parameters
$fragments : array<int, string>

URL path segments (resource name already consumed)

$params : array<string, mixed>

POST/JSON body parameters

Return values
JsonResponse

routePut()

Handle a PUT request for this resource.

public routePut(array<int, string> $fragments, array<string, mixed> $params) : JsonResponse
Parameters
$fragments : array<int, string>

URL path segments (resource name already consumed)

$params : array<string, mixed>

JSON body parameters

Return values
JsonResponse

        
On this page

Search results