22.08.2013 Views

ColdFusion Developer's Guide

ColdFusion Developer's Guide

ColdFusion Developer's Guide

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta<br />

Scope Description<br />

Form Contains variables passed from a Form page to its action page as the<br />

result of submitting the form. (If you use the HTML form tag, you must use<br />

method="post".) For more information, see Chapter 28, “Introduction to<br />

Retrieving and Formatting Data.”<br />

function local Contains variables that are declared inside a user-defined function or<br />

<strong>ColdFusion</strong> component method and exist only while a function executes.<br />

For more information, see Chapter 9, “Writing and Calling User-Defined<br />

Functions.”<br />

Request Used to hold data that must be available for the duration of one HTTP<br />

request. The Request scope is available to all pages, including custom<br />

tags and nested custom tags, that are processed in response to the<br />

request.<br />

This scope is useful for nested (child/parent) tags. This scope can often be<br />

used in place of the Application scope, to avoid the need for locking<br />

variables. Several chapters discuss using the Request scope.<br />

Server Contains variables that are associated with the current <strong>ColdFusion</strong> server.<br />

This scope lets you define variables that are available to all your<br />

<strong>ColdFusion</strong> pages, across multiple applications. For more information, see<br />

Chapter 15, “Using Persistent Data and Locking.”<br />

Session Contains variables that are associated with one client and persist only as<br />

long as the client maintains a session. They are stored in the server’s<br />

memory and can be set to time out after a period of inactivity. For more<br />

information, see Chapter 15, “Using Persistent Data and Locking.”<br />

This Exists only in <strong>ColdFusion</strong> components or cffunction tags that are part of a<br />

containing object such as a <strong>ColdFusion</strong> Struct. Exists for the duration of<br />

the component instance or containing object. Data in the This scope is<br />

accessible from outside the component or container by using the instance<br />

or object name as a prefix.<br />

ThisTag Used only in custom tag pages. The ThisTag scope is active for the current<br />

invocation of the tag. If a custom tag contains a nested tag, any ThisTag<br />

scope values you set before calling the nested tag are preserved when the<br />

nested tag returns to the calling tag.<br />

The ThisTag scope includes three built-in variables that identify the tag’s<br />

execution mode, contain the tag’s generated contents, and indicate<br />

whether the tag has an end tag.<br />

A nested custom tag can use the cfassociate tag to return values to the<br />

calling tag’s ThisTag scope. For more information, see “Accessing tag<br />

instance data” on page 292.<br />

Thread Variables that are created and changed inside a <strong>ColdFusion</strong> thread, but<br />

can be read by all code on the page that creates the thread.<br />

74 Using <strong>ColdFusion</strong> Variables

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!