Please note, this is a STATIC archive of website www.javatpoint.com from 19 Jul 2022, cach3.com does not collect or store any user information, there is no "phishing" involved.
Javatpoint Logo
Javatpoint Logo

Phalcon Responses

In Phalcon when any request is generated, the user provides the manual response or the response is given by controller. Response file is generated under Phalcon\Http\Response. Http responses are usually composed by headers and body.

Example

Output

Phalcon Response 1

Methods for Response

Methods Description
public setDI (Phalcon\DiInterface $dependencyInjector) Sets the dependency injector
public getDI () Returns the internal dependency injector.
public setStatusCode (mixed $code, [mixed $message] Sets the HTTP response code.
public getStatusCode () Returns the status code.
public setHeaders (Phalcon\Http\Response\HeadersInterface $headers) Sets a headers bag for the response externally.
public getHeaders () Returns headers set by the user.
public setCookies (Phalcon\Http\Response\CookiesInterface $cookies) Sets a cookies bag for the response externally.
public Phalcon\Http\Response\CookiesInterface getCookies () Returns cookies set by the user.
public resetHeaders () Resets all the established headers.
public setExpires (DateTime $datetime) Sets an Expires header in the response that allows to use the HTTP cache.
public setNotModified () Sends a Not-Modified response.
public setContentType (mixed $contentType, [mixed $charset]) Sets the response content-type mime, optionally the charset.
public setEtag (mixed $etag) Set a custom ETag.
public setContent (mixed $content) Sets HTTP response body.
public getContent () Gets the HTTP response body.






Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA