PAGE Methods
Including templates and objects
content(), module(), object()Request content via AJAX
collect(), complete(), elements(), element()Insert code (CSS, JS, HTML)
style(), script(), meta(), bottom(), tracking()Template data
directory(), views(), details(), preview(), charset(), language(), error()Reading and writing META data
title(), topic(), descr(), claim(), robots(), keywords()HTTP header
mime(), status(), expires(), header(), download()
mime()
Allows you to get or to manually set the pages MIME Type. If you use the approriate prefix for your template, the setting will be done automatically. If you wish to change the output's content-type use the header() function in connection with this function and see our example below. See the download() function which provides an opportunity to download files.
string mime( string filetype [, bool set = true ])
Return
Sets the page's MIME Type
Parameter
Description
filetypeThe filetype can be a file extension as well as the whole filename
setSet MIME Type, if FALSE function will return a string showing the type's setting
Get page's current MIME type
$PAGE->mime()
RETURN: 'text/html'
Get MIME-Type
$PAGE->mime('txt', false)
RETURN: 'text/plain'
Get file's MIME-Type
$PAGE->mime("example.pdf", false)
RETURN: 'application/pdf'
Click HERE to turn this page into TXT-file
1$PAGE->mime('txt')
RETURN: FALSE