Compiling Several Linked Files Into One File

<!--- Check to see which mode we are executing. --->
<cfswitch expression="#THISTAG.ExecutionMode#">
 
	<cfcase value="Start">
 
		<!--- Get base tag data. --->
		<cfset VARIABLES.FilesTag = GetBaseTagData( "cf_files" ) />
 
 
		<!--- Param tag attributes. --->
 
		<!--- This is the expanded path to the given file. --->
		<cfparam
			name="ATTRIBUTES.Path"
			type="string"
			/>
 
 
		<!---
			Check to see if we even need to worry about this
			file. Only go further if the base tags contains
			the rebuild flag.
		--->
		<cfif NOT VARIABLES.FilesTag.Rebuild>
 
			<!---
				We have no need to use the child tag, so exit
				it without processing.
			--->
			<cfexit method="exittag" />
 
		</cfif>
 
 
		<!---
			ASSERT: At this point, we know that the compiled
			file needs to be rebuilt and therefore we will need
			to check this child tag.
		--->
 
 
		<!---
			Store path in base tag. Check to see if the file
			exists so that we only have valid files passed
			up to the base tag.
		--->
		<cfif FileExists( ATTRIBUTES.Path )>
 
			<cfset ArrayAppend(
				VARIABLES.FilesTag.FilePaths,
				ATTRIBUTES.Path
				) />
 
		</cfif>
 
	</cfcase>
 
	<cfcase value="End">
 
	</cfcase>
 
</cfswitch>

For Cut-and-Paste