MvcLite\Response
Base Response
- Author: Cory Collier <corycollier@corycollier.com>
Synopsis
- // constants
- const DEFAULT_CONTENT_TYPE = 'application/json';
- const ERR_INVALID_CONTENT_TYPE = 'The given content-type [%s] is not valid';
- // Inherited constants from ObjectAbstract
- const MSG_ERR_IDENTIFY = 'Descendents must implement the identify method';
- // methods
- public void init()
- public Response setHeader()
- public Response setHeaders()
- public string getHeader()
- public array getHeaders()
- public Response sendHeaders()
- public Response setBody()
- public string getBody()
- public Response setContentType()
- public string getContentType()
- // Inherited methods from ObjectAbstract
- public final void __get()
- public final void __set()
- public final void __call()
- public void __toString()
- public string identify()
- // Inherited methods from Singleton
- public static Singleton getInstance()
Hierarchy
Coverage
Methods | 100% | 10 / 10 |
Lines | 100% | 34 / 34 |
Constants
Name | Value |
---|---|
DEFAULT_CONTENT_TYPE | 'application/json' |
ERR_INVALID_CONTENT_TYPE | 'The given content-type [%s] is not valid' |
MSG_ERR_IDENTIFY | 'Descendents must implement the identify method' |
Members
protected
- $body
—
string
The body of the response - $headers
—
array
A list of headers to be output - $instance
—
MvcLite\Traits\Singleton
Static instance variable
Methods
public
- getBody() — gets the response body
- getContentType() — Getter for the content type.
- getHeader() — gets the header by name
- getHeaders() — Returns all of the headers
- init() — method to start the response up
- sendHeaders() — Function to return a formatted header string
- setBody() — set the body of the response
- setContentType() — Setter for the content type.
- setHeader() — Set's a header value
- setHeaders() — Set multiple headers at one time
Inherited from MvcLite\ObjectAbstract
public
- __call() — Overriding the __call magic method
- __get() — Overriding the __get magic method
- __set() — Overriding the __set magic method
- __toString() — returns a string representation of the object
- identify() — method used to identify the object instance
Inherited from MvcLite\Traits\Singleton
public
- getInstance() — Getter for the instance variable.
History
-
2015-12-21T13:08:25-05:00 (commit #5617538)
Author: Cory Collier (corycollier@corycollier.com) / Commiter: Cory Collier (corycollier@corycollier.com)
Updating the response class to allow for setting/getting of content type. Updating the request to read the content type, allowing for semicolon separated values, implementing the content-type acknowledgement in the dispatcher
-
2015-12-15T09:42:10-05:00 (commit #0bcf089)
Author: Cory Collier (corycollier@corycollier.com) / Commiter: Cory Collier (corycollier@corycollier.com)
A lot of code minor code cleanup. Updating some methods to split up code a bit
-
2015-12-14T07:03:35-05:00 (commit #ca452e0)
Author: Cory Collier (corycollier@corycollier.com) / Commiter: Cory Collier (corycollier@corycollier.com)
Removing the Database class, trait, and associated tests. Cleaning up some of the declarations on the filter and view helper classes
-
2015-12-02T16:43:15-05:00 (commit #55a67b0)
Author: Cory Collier (ccollier@redhat.com) / Commiter: Cory Collier (ccollier@redhat.com)
BIG commit. Leveraging php5.4 shorthand for arrays, updating the skeleton app, Adding the Filepath trait, implementing the filepath trait, new Filters, Moved the registry to a new config class, created a new config trait, implemented new config trait, updated a TON of unit tests
-
2015-11-30T18:03:08-05:00 (commit #edb2b58)
Author: Cory Collier (ccollier@redhat.com) / Commiter: Cory Collier (ccollier@redhat.com)
LOTS of code cleanup here. Fixing unit tests for those cleanups as well
-
2015-11-29T18:06:20-05:00 (commit #93e1571)
Author: Cory Collier (ccollier@redhat.com) / Commiter: Cory Collier (ccollier@redhat.com)
fixing phpcs issues in the session and associated testcase class. Updating unit tests for the session class
-
2015-11-29T17:45:29-05:00 (commit #e03c94c)
Author: Cory Collier (ccollier@redhat.com) / Commiter: Cory Collier (ccollier@redhat.com)
Fixing phpcs issues in the response class, and associated unit test case. Updating unit tests for the response class
-
2015-11-29T13:59:13-05:00 (commit #5ca1372)
Author: Cory Collier (ccollier@redhat.com) / Commiter: Cory Collier (ccollier@redhat.com)
,
-
2015-11-27T22:46:57-05:00 (commit #3067c88)
Author: Cory Collier (ccollier@redhat.com) / Commiter: Cory Collier (ccollier@redhat.com)
Provisional commit - Not done moving things around to be namespace compliant. This commit is completely not functional
-
2015-11-11T08:14:50-05:00 (commit #ad28461)
Author: Cory Collier (corycollier@corycollier.com) / Commiter: Cory Collier (corycollier@corycollier.com)
More moving things around
-
2015-11-11T08:07:21-05:00 (commit #3838504)
Author: Cory Collier (corycollier@corycollier.com) / Commiter: Cory Collier (corycollier@corycollier.com)
Re-introducing the library components as first class items