Scopes in Coldfusion

Other topics

Request Scopes

request

variables

form

url

cgi

Global Scopes

Server

Application

Session

Components and functions

variables

this

local

arguments

Custom tags

attributes

thisTag

caller

Common scopes

Mostly you're probably working with these scopes:

  • Variables scope is the scope where all variables are assigned to when nothing else is intentionally declared (like the window scope in JavaScript).
  • Form scope When you send a form to your server, all the form fields which can be identified (by setting the name/id property) are accessible in this scope for further server-side processing.
  • URL scope All url query params are stored in that scope
  • this scope Inside a component the this refers to the component itself
  • local scope Variables declared inside a function using the local statement are encapsulated and only accessible inside that specific function (this is made to avoid pollution of other sopes)
  • Arguments scope Arguments passed to a function inside a component declared by the cfargument tag are accessible with that scope

Overview

  • Components and functions

    • variables
    • this
    • local
    • arguments
  • Custom tags

    • attributes
    • thisTag
    • caller
  • Global Scopes

    • Server
    • Application
    • Session
  • Request Scopes

    • request
    • variables
    • form
    • url
    • cgi

Contributors

Topic Id: 7864

Example Ids: 25568,25569,25570,25571,32084,32098

This site is not affiliated with any of the contributors.