Elgg  Version 6.1
Public Member Functions | List of all members
Elgg\Http\DownloadResponse Class Reference

Download response builder. More...

Inheritance diagram for Elgg\Http\DownloadResponse:
Elgg\Http\OkResponse Elgg\Http\Response Elgg\Http\ResponseBuilder

Public Member Functions

 getHeaders ()
 Returns additional response headers.
Returns
array
More...
 
 setForwardURL (string $forward_url=REFERRER)
 Sets redirect URL.
Parameters
string$forward_urlForward URL
Returns
self
Exceptions
InvalidArgumentException
More...
 
 setFilename (string $filename= '', bool $inline=false)
 Set the filename for the download. More...
 
- Public Member Functions inherited from Elgg\Http\OkResponse
 __construct ($content= '', int $status_code=ELGG_HTTP_OK, string $forward_url=null)
 Constructor. More...
 
- Public Member Functions inherited from Elgg\Http\Response
 setContent ($content= '')
 {Sets response body.
Parameters
mixed$contentContent of the response as a scalar value or an array
Returns
self
Exceptions
InvalidArgumentException
} More...
 
 getContent ()
 {Returns response body.
Returns
mixed
} More...
 
 setException (\Exception $e)
 {Set an exception for this response.
Parameters
\Exception$ethe exception for this response
Returns
self
} More...
 
 getException ()
 {Get the exception for this reponse.
Returns
|null
} More...
 
 setStatusCode (int $status_code)
 {Sets response HTTP status code.
Parameters
int$status_codeStatus code
Returns
self
Exceptions
RangeException
} More...
 
 getStatusCode ()
 {Returns status code.
Returns
int
} More...
 
 setForwardURL (string $forward_url=REFERRER)
 {Sets redirect URL.
Parameters
string$forward_urlForward URL
Returns
self
Exceptions
InvalidArgumentException
} More...
 
 getForwardURL ()
 {Returns redirect URL.
Returns
string|null string the forward url, null when no url was set or the constant REFERRER
} More...
 
 setHeaders (array $headers=[])
 {Sets additional response headers.
Parameters
array$headersHeaders
Returns
self
} More...
 
 getHeaders ()
 {Returns additional response headers.
Returns
array
} More...
 
 isInformational ()
 {Check if response is informational.
Returns
bool
} More...
 
 isSuccessful ()
 {Check if response is successful.
Returns
bool
} More...
 
 isOk ()
 {Check if response is OK.
Returns
bool
} More...
 
 isRedirection ()
 {Check if response is redirection.
Returns
bool
} More...
 
 isClientError ()
 {Check if response is client error.
Returns
bool
} More...
 
 isServerError ()
 {Check if response is server error.
Returns
bool
} More...
 
 isNotModified ()
 {Check if response has been modified.
Returns
bool
} More...
 

Additional Inherited Members

- Protected Attributes inherited from Elgg\Http\Response
 $content
 
int $status_code
 
string $forward_url = null
 
array $headers = []
 
Exception $exception = null
 
bool $secure_forward_url = true
 

Detailed Description

Download response builder.

Since
5.0

Definition at line 10 of file DownloadResponse.php.

Member Function Documentation

Elgg\Http\DownloadResponse::getHeaders ( )

Returns additional response headers.

Returns
array

Implements Elgg\Http\ResponseBuilder.

Definition at line 15 of file DownloadResponse.php.

Elgg\Http\DownloadResponse::setFilename ( string  $filename = '',
bool  $inline = false 
)

Set the filename for the download.

This will only be applied if the 'Content-Disposition' header isn't already set

Parameters
string$filenameThe filename when downloaded
bool$inlineIs this an inline download (default: false, determines the 'Content-Disposition' header)
Returns
self

Definition at line 54 of file DownloadResponse.php.

Elgg\Http\DownloadResponse::setForwardURL ( string  $forward_url = REFERRER)

Sets redirect URL.

Parameters
string$forward_urlForward URL
Returns
self
Exceptions
InvalidArgumentException

Implements Elgg\Http\ResponseBuilder.

Definition at line 40 of file DownloadResponse.php.


The documentation for this class was generated from the following file: