Bluz\Response\Response
Response Container
- Author: Anton Shevchuk
Synopsis
- // members
- protected string $protocol = '1.1';
- protected integer $code = StatusCode::OK;
- protected string|null $phrase;
- protected array $headers = ;
- protected array $cookies = ;
- protected Controller $body;
- protected string $type = 'HTML';
- // methods
- public void send()
- public string getType()
- public void setType()
- public string getProtocolVersion()
- public integer getStatusCode()
- public void setStatusCode()
- public string|null getReasonPhrase()
- public void setReasonPhrase()
- public string getHeader()
- public array getHeaderAsArray()
- public bool hasHeader()
- public void setHeader()
- public void addHeader()
- public void removeHeader()
- public array getHeaders()
- public void setHeaders()
- public void addHeaders()
- public void removeHeaders()
- public void setBody()
- public Controller|Layout getBody()
- public void clearBody()
- public void setCookie()
- public array|null getCookie()
- protected void sendCookies()
- // Inherited methods from Options
- public mixed getOption()
- public void setOption()
- public array getOptions()
- public Options setOptions()
- protected void initOptions()
Hierarchy
Uses
Members
protected
- $body — Bluz\Controller\Controller
- $code — integer
- $headers — array
- $options — array
- $phrase — Bluz\Response\string|null
- $protocol — string
- $type — string
Methods
protected
- sendCookies() — Process Cookies to Header
public
- addHeader() — Appends a header value for the specified header
- addHeaders() — Merges in an associative array of headers.
- clearBody() — Clear response body
- getBody() — Get response body
- getCookie() — Get Cookie by name
- getHeader() — Retrieve a header by the given case-insensitive name as a string
- getHeaderAsArray() — Retrieves a header by the given case-insensitive name as an array of strings
- getHeaders() — Gets all message headers
- getProtocolVersion() — Gets the HTTP protocol version as a string
- getReasonPhrase() — Gets the response Reason-Phrase, a short textual description of the Status-Code
- getStatusCode() — Gets the response Status-Code
- getType() — Get response type
- hasHeader() — Checks if a header exists by the given case-insensitive name
- removeHeader() — Remove a specific header by case-insensitive name.
- removeHeaders() — Remove all headers
- send() — send
- setBody() — Set response body
- setCookie() — Set Cookie
- setHeader() — Sets a header, replacing any existing values of any headers with the same case-insensitive name
- setHeaders() — Sets headers, replacing any headers that have already been set on the message
- setReasonPhrase() — Sets the Reason-Phrase of the response
- setStatusCode() — Sets the status code of this response
- setType() — Set Response Type, one of JSON, HTML or CLI
Inherited from Bluz\Common\Options
protected
- initOptions() — Check and initialize options in package
public
- getOption() — Get option by key
- getOptions() — Get all options
- setOption() — Set option by key over setter
- setOptions() — Setup, check and init options
History
-
2017-07-18T12:44:53+00:00 (commit #cc068ce)
Author: Anton Shevchuk (AntonShevchuk@gmail.com) / Commiter: Anton Shevchuk (AntonShevchuk@gmail.com)
Created tests for Controller Helpers Added method `Response::getType()` Renamed method `Response::switchType()` to `Response::setType()`
-
2017-07-11T07:52:52+00:00 (commit #9fd121c)
Author: Anton Shevchuk (AntonShevchuk@gmail.com) / Commiter: Anton Shevchuk (AntonShevchuk@gmail.com)
Updated comment's blocks
-
2017-06-30T08:36:40+00:00 (commit #2259ecf)
Author: Anton Shevchuk (AntonShevchuk@gmail.com) / Commiter: Anton Shevchuk (AntonShevchuk@gmail.com)
Fixed comments style
-
2017-04-21T15:28:30+00:00 (commit #f0410e7)
Author: Anton Shevchuk (AntonShevchuk@gmail.com) / Commiter: Anton Shevchuk (AntonShevchuk@gmail.com)
Replace `join` with `implode`
-
2017-04-21T13:24:35+00:00 (commit #3b25a3d)
Author: Anton Shevchuk (AntonShevchuk@gmail.com) / Commiter: Anton Shevchuk (AntonShevchuk@gmail.com)
Small update for codestyle
-
2017-04-11T10:10:50+00:00 (commit #fc9ab01)
Author: Anton Shevchuk (AntonShevchuk@gmail.com) / Commiter: Anton Shevchuk (AntonShevchuk@gmail.com)
Removed CLI response from framework (use Symfony console instead)
-
2017-02-15T16:09:44+00:00 (commit #0fc0c8b)
Author: Anton Shevchuk (AntonShevchuk@gmail.com) / Commiter: Anton Shevchuk (AntonShevchuk@gmail.com)
Updated coveralls config
-
2017-02-13T10:14:18+00:00 (commit #43dbf55)
Author: Anton Shevchuk (AntonShevchuk@gmail.com) / Commiter: Anton Shevchuk (AntonShevchuk@gmail.com)
Rollback to `getCount()` method
-
2017-01-30T13:15:49+00:00 (commit #fd5d943)
Author: Anton (AntonShevchuk@gmail.com) / Commiter: GitHub (AntonShevchuk@gmail.com)
Merge pull request #395 from AntonShevchuk/master Added `AttachmentResponse`
-
2017-01-30T12:38:53+00:00 (commit #0ab8691)
Author: Anton Shevchuk (AntonShevchuk@gmail.com) / Commiter: Anton Shevchuk (AntonShevchuk@gmail.com)
Added `AttachmentResponse` Added `attachment($file)` helper for `Controller`