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

Summary

Custom Tags allow you and your development team to create modular code with an incredible degree of maintainability. Custom Tags can be written with or without attributes, and can be invoked in a number of ways. Within the Custom Tag, you should perform validation on the attributes and set default values for them as necessary. Custom Tags can also return data to calling pages (via the CALLER scope scope); this capability must be used with care.

Sample Questions

1:Which code would you use to create a variable in a Custom Tag that could be passed back into the calling page?
  1. <cfset FirstName="Emily">

  2. <cfset Caller.FirstName="Emily">

  3. <cfset SetVariable(FirstName, "Emily")>

  4. <cfset ExposeVariable(FirstName, "Emily")>

2:Assuming a default installation on a Windows machine, which file could be executed if <cf_mytag> were used in your code? (select two)
  1. C:\cfusionmx7\MyTag.cfm

  2. MyTag.cfm in the current directory

  3. C:\cfusionmx7\customtags\MyTag.cfm

  4. c:\customtags\MyTag.cfm

3:What is the best way to set default values for optional Custom Tag attributes?
  1. <cfparam name="ATTRIBUTES.MyAttribute" default="MyValue">

  2. <cfset MyAttribute="MyValue">

  3. <input type="hidden" name="MyAttribute" value="MyValue">

  4. <cf_mycustomtag myattribute="MyValue>


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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