Question
cfloop within a cfif tag
Is it possible to nest a cfloop inside a cfif tag?
I'm outputting a directory listing of files, but only want to allow certain file types. I can do something such as:
<cfif dir.name CONTAINS ".cfm" OR dir.name CONTAINS ".html"...>
However, it would be much nicer if I could just store a list of file extensions in a variable and have a cfif statement that loops through them. That would make it much easier to add or remove extensions from the list of allowed file types. Is this doable? If not, is there something similar I could do?
I'm outputting a directory listing of files, but only want to allow certain file types. I can do something such as:
<cfif dir.name CONTAINS ".cfm" OR dir.name CONTAINS ".html"...>
However, it would be much nicer if I could just store a list of file extensions in a variable and have a cfif statement that loops through them. That would make it much easier to add or remove extensions from the list of allowed file types. Is this doable? If not, is there something similar I could do?
