<cfprocessingdirective>
Sets compiler directives that affect the entire template. Unlike most CFML tags, cfprocessingdirective is processed at compile time and must be placed at the root level of your template.
This tag may have a body.
This tag is also supported within <cfscript>
<cfprocessingdirective
suppressWhiteSpace=boolean
executionLog=boolean
pageEncoding=string
preserveCase=boolean
><!--- body --->[</cfprocessingdirective>]
| Attribute | Description |
|---|---|
suppressWhiteSpace
boolean, optional
|
edit
When set to true, removes unnecessary whitespace from the generated HTML output, reducing the file size and potentially improving page load times. This includes:
Example: suppressWhiteSpace="true" |
executionLog
boolean, optional
|
edit
Controls whether execution time logging is enabled for this template. When set to true, Lucee will log performance metrics for this template, which can be valuable for debugging and optimization. Example: executionLog="true" |
pageEncoding
string, optional
|
edit
Specifies the character encoding used for the current template file. This must be a string literal corresponding to a valid character encoding (not a dynamic expression). Common values:
Example: pageEncoding="UTF-8" |
preserveCase
boolean, optional
|
edit
Controls how variable keys defined using dot notation are handled:
|
Examples
editSimple Example
<cfprocessingdirective suppresswhitespace="true" executionlog="true" pageencoding="UTF-8" preservecase="false">
<cfset myStruct = {}>
<cfset myStruct.dotNotation = "Hello World">
<cfset myStruct["bracketNotation"] = " utf-8 Encoding">
<cfdump var="#myStruct#" label="preservecase"/>
<cfoutput>
Dot Notation : #myStruct.DOTNOTATION#<br>
Bracket Notation : #myStruct["bracketNotation"]#
</cfoutput>
</cfprocessingdirective>
See also
- Debugging
- Lucee Server related Tags, Functions and Guides
- <cfoutput>
- <cfsetting>
- Search Issue Tracker open_in_new
- Search Lucee Test Cases open_in_new (good for further, detailed examples)