Method |
Description |
|
__construct ( Request $request, PluginHooksService $hooks, Service $ajax, Elgg\Http\ResponseTransport $transport ) |
Constructor |
|
getHeaders ( boolean $remove_existing = true ) : ResponseHeaderBag |
Get headers set to apply to all responses |
|
getSentResponse ( ) : Response | false |
Returns a response that was sent to the client |
|
isAction ( ) : boolean |
Check if the requested path is an action |
|
isXhr ( ) : boolean |
Check if the request is an XmlHttpRequest |
|
normalize ( mixed $content = '' ) : mixed |
Normalizes content into serializable data by walking through arrays
and objectifying Elgg entities |
|
parseContext ( ) : string |
Parses response type to be used as plugin hook type |
|
prepareRedirectResponse ( string $url, integer $status = 302, array $headers = [] ) : RedirectResponse |
Creates a redirect response |
|
prepareResponse ( string $content = '', integer $status = 200, array $headers = [] ) : Response |
Creates an HTTP response |
|
redirect ( string $forward_url = REFERRER, mixed $status_code = ELGG_HTTP_FOUND ) : RedirectResponse |
Prepares a redirect response |
|
respond ( Elgg\Http\ResponseBuilder $response ) : Response |
Send HTTP response |
|
respondFromContent ( string $content = '', integer $status_code = ELGG_HTTP_OK, array $headers = [] ) : type |
Send OK response |
|
respondWithError ( string $error, integer $status_code = ELGG_HTTP_BAD_REQUEST, array $headers = [] ) : Response |
Send error HTTP response |
|
send ( Response $response ) : Response |
Send a response |
|
setHeader ( string $name, string $value, boolean $replace = true ) : void |
Sets headers to apply to all responses being sent |
|
stringify ( mixed $content = '' ) : string |
Stringify/serialize response data |
|
wrapLegacyAjaxResponse ( string $content = '', string $forward_url = REFERRER ) : string |
Wraps content for compability with legacy Elgg ajax calls |
|