![]() For the main application response, you do not need to call This will first send the headers,įollowed by the response body. Tells the response to send everything back to the client. setLastModified ( date ( 'D, d M Y H:i:s' )) $response -> setLastModified ( DateTime :: createFromFormat ( '!U', $timestamp )) send ( ) → Response Returns ![]() If no status code has been set, a BadMethodCallException Returns the currently status code for this response. ![]() The current HTTP status code for this response Return type The methods provided by the parent class that are available are:ĬodeIgniter\HTTP\Message::populateHeaders()ĬodeIgniter\HTTP\Message::protocolVersion()ĬodeIgniter\HTTP\Message::setProtocolVersion()ĬodeIgniter\HTTP\Message::negotiateMedia()ĬodeIgniter\HTTP\Message::negotiateCharset()ĬodeIgniter\HTTP\Message::negotiateEncoding()ĬodeIgniter\HTTP\Message::negotiateLanguage()Ĭlass CodeIgniter\HTTP\ Response getStatusCode ( ) Returns In addition to the methods listed here, this class inherits the methods from the This is usually used in conjunction with setting the status code of When you need to set the output of the script directly, and not rely on CodeIgniter to automatically get it, youĭo it manually with the setBody method. Powerful HTTP caching, it’s there for you. When things go wrong, or you need to send very specific status codes back, or even take advantage of the This is great if the page successfully created the content it was asked to. Sending the headers and the body for you. Many times you will not need to touch the class directly, since CodeIgniter takes care of It canīe accessed through $this->response. A Response class is instantiated for you and passed into your controllers. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |