Forum Moderators: phranque

Message Too Old, No Replies

Cold Fusion Question

         

brucec

2:22 pm on May 29, 2004 (gmt 0)

10+ Year Member



I am learning Cold Fusion and I have a simple question.

When passing data in a GET statement, I know that you can use the "URL." prefix before variables in the <CFOUTPUT> tag and you get the same results without it.

So, if my Cold Fusion variable is called "color", what is the advantage of using #URL.color# as opposed to just #color#?

Captaffy

5:58 am on May 30, 2004 (gmt 0)

10+ Year Member



I haven't used Coldfusion in about five months, but from what I remember-

1. You should refer to it as #url.color# so that when you come back to read your code at some later date, you will know that you are using the GET value there, as opposed to some other variable you defined.

2. I think if you define a variable called color before you use #color#, it will return the vaue you defined, as opposed to the GET value. #url.color# will always return the GET value.

You should definitely do it even if #2 is not true, because you want to make your code as clear as possible for whoever is going to be reading it in five months.