Method: content::type
Simplifies setting content type headers
Info
Syntax
content::type()
Parameters
- $ctype (string) The shortcut for the content type. See the keys of the $ctypes array for all available shortcuts
- $charset (string) The charset definition for the content type header. Default is "utf-8"
Example
content::type('js');
// some javascript
content::type('png');
// some png
content::type('text/rtf', 'iso-8859-1');
// rtf document
/*
more available shortcuts:
- html => text/html
- css => text/css
- json => application/json
- jpg => image/jpeg
- gif => image/gif
*/