Reputation: 203
I want a if condition in ColdFusion which is check #firstWordCategory#
variable is defined or not.
Upvotes: 0
Views: 7554
Reputation: 6236
Every variable will be in some scope and scope(mostly) is simply a structure.
So, you can use structKeyExists()
like this:
<!--- If your variable is in VARIABLES scope --->
<cfif structKeyExists(VARIABLES, "firstWordCategory")>
<!--- Your Code --->
</cfif>
Upvotes: 9