interface RequestFilter (View source)

deprecated 4.0.0:5.0.0 Use HTTPMiddleware instead

A request filter is an object that's executed before and after a request occurs. By returning 'false' from the preRequest method, request execution will be stopped from continuing

Methods

public
bool
preRequest(HTTPRequest $request)

Filter executed before a request processes

public
bool
postRequest(HTTPRequest $request, HTTPResponse $response)

Filter executed AFTER a request

Details

bool preRequest(HTTPRequest $request)

Filter executed before a request processes

Parameters

HTTPRequest $request

Request container object

Return Value

bool

Whether to continue processing other filters. Null or true will continue processing (optional)

bool postRequest(HTTPRequest $request, HTTPResponse $response)

Filter executed AFTER a request

Parameters

HTTPRequest $request

Request container object

HTTPResponse $response

Return Value

bool

Whether to continue processing other filters. Null or true will continue processing (optional)