• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Q&A

Q1:What are some other uses of the <CFIF>tag?
A1: In addition to the uses described in this chapter, <CFIF> is also a common way to create single templates that handle a variety of activities. For example, a site might offer three types of text searches: by keyword, by data type, or by alphabetic list. By using <CFIF> and defining a "search type" parameter, a developer can handle all three search types with a single template.
Q2:Should I use <CFIF>to password-protect areas of my site?
A2: Not if security is a big concern. The sample application used in this chapter was designed to illustrate the use of <CFIF>, not to provide an impenetrable defense. In Week 3, "Maximizing and Customizing ColdFusion Applications," I'll cover ColdFusion's security functions in greater detail.
Q3:Can I "nest" <CFIF>statements by placing one within another?
A3: Yes, and by doing so you'll be harnessing some of CF's most useful powers. When using nested <CFIF> statements, it's very important to use indents in your source code because the conditional flow can quickly become hard to read without them.
Q4:Can I use computations other than addition with <CFSET>?
A4: Yes. <CFSET> canbe used in conjunction with any mathematical computation, as well as text-string functions such as masking and de-shouting (making letters lowercase). You'll find descriptions of various text-massaging functions in future chapters of this book.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint