Created
March 13, 2023 10:43
-
-
Save bennadel/3743bed5c1b66950d184bc2c8ff2e563 to your computer and use it in GitHub Desktop.
Using "return" To Short-Circuit A CFML Template In ColdFusion
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfscript> | |
writeOutput( "A-1 <br />" ); | |
return; | |
writeOutput( "A-2 <br />" ); | |
</cfscript> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfscript> | |
writeOutput( "B-1 <br />" ); | |
return; | |
writeOutput( "B-2 <br />" ); | |
</cfscript> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfscript> | |
writeOutput( server.coldfusion.productName & " - " ); | |
writeOutput( server.coldfusion.productVersion & "<br />" ); | |
include "a.cfm"; | |
include "b.cfm"; | |
writeOutput( "Done <br />" ); | |
</cfscript> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfscript> | |
(() => { | |
writeOutput( "UDF Context <br />" ); | |
writeOutput( server.coldfusion.productName & " - " ); | |
writeOutput( server.coldfusion.productVersion & "<br />" ); | |
include "a.cfm"; | |
include "b.cfm"; | |
writeOutput( "Done <br />" ); | |
})(); | |
</cfscript> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment