read complet list of cfinclude tags from coldfusion code


/ Published in: ColdFusion
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <cfset var LOCAL = StructNew() />
  2. <cfset LOCAL.Tag = StructNew() />
  3. <cfset LOCAL.templates = structnew() />
  4. <cfset LOCAL.NamePattern = CreateObject(
  5. "java",
  6. "java.util.regex.Pattern"
  7. ).Compile(
  8. "(<cfinclude[\s+]*[\w+\s*=\s*""""|[^\s>]*]*>)"
  9. )
  10. />
  11.  
  12. <cfset LOCAL.NameMatcher = LOCAL.NamePattern.Matcher(ARGUMENTS.HTML) />
  13. <cfset count = 1 >
  14. <cfloop condition="LOCAL.NameMatcher.Find()">
  15. <cfset LOCAL.Tag[count] = UCase(LOCAL.NameMatcher.Group( 1 )) />
  16. <cfset count = count +1 >
  17. </cfloop>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.