Results 1 to 1 of 1
Jun 25, 2009, 07:00 #1
- Join Date
- Apr 2009
- Wallingford, CT
- 0 Post(s)
- 0 Thread(s)
Choosing a variable based on another variable
I am trying to make an application for the backend of a website that whenever a new page is added to the subnav the actual CFM page is actually created automatically. In the CFC that does everything I have global variables that look at the category ID of the nav. AKA 1, 2, or 3.
Each category can have as many pages as you wish. The global variables say which folder the file needs to go in. So what happens is that the function looks at the catid and creates the name of the variable (AKA catID1, catID2, or catID3) I don't know how to get the actual value of the variable I just made.
<cfscript> //CatID folders catID1 = "/"; catID2 = "/computer-repair/"; catID3 = "/web-design/"; </cfscript> <cffunction name="createPage" access="remote" output="yes"> <cfargument name="navTitle" required="true" type="string"> <cfargument name="catID" required="true" type="numeric"> <cfset var folder = ""> <cfset var urllink = ""> <cfscript> folder = "catID" & ARGUMENTS.catid; folder = </cfscript>