Skip to content

Configuration

addFormat()

addFormat() — returns void

Available in: controller, model, test, migrator, migration, tabledefinition Category: Miscellaneous Functions

Adds a new MIME type to your CFWheels application for use with responding to multiple formats.

NameTypeRequiredDefaultDescription
extensionstringyesFile extension to add.
mimeTypestringyesMatching MIME type to associate with the file extension.
// Add the `js` format
addFormat(extension="js", mimeType="text/javascript");

// Add the `ppt` and `pptx` formats
addFormat(extension="ppt", mimeType="application/vnd.ms-powerpoint");
addFormat(extension="pptx", mimeType="application/vnd.ms-powerpoint");