File extends HttpResponse
Table of Contents
Constants
- STORE_COOKIE_NAME = 'STORE_COOKIES'
Methods
- __construct() : mixed
- addCookie() : $this
- Adds a cookie to the response.
- addHeader() : $this
- Adds an HTTP header field to the response.
- allowPersistentCookies() : mixed
- Remembers user's choice about storing persistent cookies.
- appendContent() : $this
- Appends content.
- clear() : mixed
- copyHeadersTo() : HttpResponse
- flush() : mixed
- Flushes the content to the output buffer. All following output will be ignored.
- getCacheTime() : int
- getContent() : string
- Returns content of response.
- getContentType() : string
- getCookies() : array<string|int, Cookie>
- getHeaders() : HttpHeaders
- getName() : null
- getPath() : mixed
- getStatus() : int
- Returns the HTTP status of the response.
- isShowInline() : bool
- redirectTo() : Redirect
- send() : void
- Sends content to the output.
- setCacheTime() : File
- setContent() : $this
- Sets content.
- setContentType() : File
- setHeaders() : $this
- Sets a collection of HTTP headers.
- setLastModified() : $this
- Sets the latest time for the Last-Modified header field.
- setName() : File
- setPath() : File
- setStatus() : $this
- Sets the HTTP status of the response.
- showInline() : File
- writeHeaders() : mixed
- Flushes all headers and cookies
Constants
STORE_COOKIE_NAME
public
mixed
STORE_COOKIE_NAME
= 'STORE_COOKIES'
Methods
__construct()
public
__construct(mixed $path[, mixed $name = null ][, mixed $contentType = 'application/octet-stream' ]) : mixed
Parameters
- $path : mixed
- $name : mixed = null
- $contentType : mixed = 'application/octet-stream'
addCookie()
Adds a cookie to the response.
public
addCookie(Cookie $cookie[, bool $replace = true ][, bool $checkExpires = true ]) : $this
Parameters
- $cookie : Cookie
-
The cookie.
- $replace : bool = true
-
Replace an existing cookie or not.
- $checkExpires : bool = true
-
Check expires value of the cookie or not.
Return values
$thisaddHeader()
Adds an HTTP header field to the response.
public
addHeader(string $name[, string $value = '' ]) : $this
Parameters
- $name : string
-
Header field name
- $value : string = ''
-
Header field value
Tags
Return values
$thisallowPersistentCookies()
Remembers user's choice about storing persistent cookies.
public
allowPersistentCookies(bool $mode) : mixed
Parameters
- $mode : bool
appendContent()
Appends content.
public
appendContent(mixed $content) : $this
Valid types are strings, numbers, null, and objects that implement a __toString() method.
Parameters
- $content : mixed
-
Content that can be cast to string.
Tags
Return values
$thisclear()
public
clear() : mixed
copyHeadersTo()
public
copyHeadersTo(HttpResponse $response) : HttpResponse
Parameters
- $response : HttpResponse
Return values
HttpResponseflush()
Flushes the content to the output buffer. All following output will be ignored.
public
flush([string $text = '' ]) : mixed
Parameters
- $text : string = ''
getCacheTime()
public
getCacheTime() : int
Return values
intgetContent()
Returns content of response.
public
getContent() : string
Return values
stringgetContentType()
public
getContentType() : string
Return values
stringgetCookies()
public
getCookies() : array<string|int, Cookie>
Return values
array<string|int, Cookie>getHeaders()
public
getHeaders() : HttpHeaders
Return values
HttpHeadersgetName()
public
getName() : null
Return values
nullgetPath()
public
getPath() : mixed
getStatus()
Returns the HTTP status of the response.
public
getStatus() : int
Return values
intisShowInline()
public
isShowInline() : bool
Return values
boolredirectTo()
public
final redirectTo(mixed $url) : Redirect
Parameters
- $url : mixed
Return values
Redirectsend()
Sends content to the output.
public
send() : void
setCacheTime()
public
setCacheTime(int $cacheTime) : File
Parameters
- $cacheTime : int
Return values
FilesetContent()
Sets content.
public
setContent(mixed $content) : $this
Valid types are strings, numbers, null, and objects that implement a __toString() method.
Parameters
- $content : mixed
-
Content that can be cast to string.
Tags
Return values
$thissetContentType()
public
setContentType(string $contentType) : File
Parameters
- $contentType : string
Return values
FilesetHeaders()
Sets a collection of HTTP headers.
public
setHeaders(HttpHeaders $headers) : $this
Parameters
- $headers : HttpHeaders
-
Headers collection.
Return values
$thissetLastModified()
Sets the latest time for the Last-Modified header field.
public
setLastModified(DateTime $time) : $this
Parameters
- $time : DateTime
Return values
$thissetName()
public
setName(null $name) : File
Parameters
- $name : null
Return values
FilesetPath()
public
setPath(mixed $path) : File
Parameters
- $path : mixed
Return values
FilesetStatus()
Sets the HTTP status of the response.
public
setStatus(string|int $status) : $this
Parameters
- $status : string|int
Return values
$thisshowInline()
public
showInline(bool $enabled) : File
Parameters
- $enabled : bool
Return values
FilewriteHeaders()
Flushes all headers and cookies
public
writeHeaders() : mixed