| API | Package | Subpackage | Class | Method | Reference | Last reviewed | Doc status |
|---|---|---|---|---|---|---|---|
Home |
Joomla.Framework |
Document |
JDocument |
setMimeEncoding |
setMimeEncoding() |
Never | Work in Progress |
Sets the document MIME encoding that is sent to the browser. This usually will be text/html because most browsers cannot yet accept the proper mime settings for XHTML: application/xhtml+xml, and to a lesser extent application/xml and text/xml. See the W3C note (http://www.w3.org/TR/xhtml-media-types/) for more details.
void setMimeEncoding ( $type )
| $type | string | is a string containing the MIME type. This parameter is optional and if omitted defaults to ‘text/html’. |
Set the mime type of the current document.
Example
global $mainframe; $document =& JFactory::getDocument(); $document->setMimeEncoding( 'application/xml' ); echo "MIME Type: " . $document->getMimeEncoding();
Might produce:
Result
MIME Type: application/xml