Hi there! I'm new to ColdFusion. I used to code in PHP for developing web apps,
but I had to learn this language (I only started this Monday) because our
company requires me to do so. Initially, I found CF frustrating because it is
very inflexible in many areas. However, I'm beginning to appreciate CFs
ability to speed up developing time, although the ColdFusion language is not as
beautiful and concise as PHP and other C-like languages.
I hope you guys can help me with my transition. I have many questions in mind:
- How can I define constants? I need to use constants because <cfcase> does not
accept variables. Is there a #define or define() equivalent in CF?
- In CF, I have the impression that <cfswitch> doesn't need to break after each
<cfcase>. However, how can my code flow through the next <cfcase> such that
the result is equivalent to the following PHP code below when variable helpme
is either 'a' or 'A':
switch(helpme) {
case 'a':
case 'A':
doSomething('a');
break;
case 'B':
doSomething('b');
break;
}
- How can I surpress whitespaces such that the resulting HTML code is cleanly
formatted? CF is often frustrating because when I need to dynamically set
certain HTML attributes, CF inserts large white spaces such that the result
looks something like this:
<a href="
http://foo.com
"
>
<cfprocessingdirective> doesn't seem to work, even if I've already enabled
whitespace suppression in CFIDE.
-How can I turn off the ColdFusion equivalent of PHP's register_globals? As a
kid who likes to inject MySQL statements in my own scripts to kill time, I'm
very concerned that I might forget to use <cfparam> because CF automatically
uses the variables even if I don't specify that I passed them using POST or
GET.
-How can I make a constructor method in ColdFusion components?
That's all for now. Thank you very much for your time.
[ simon.cpu ]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Purchase Studio MX from House of Fusion, a Macromedia Authorized Affiliate and
support the CF community.
http://www.houseoffusion.com/banners/view.cfm?bannerid=50
Message: http://www.houseoffusion.com/lists.cfm/link=i:15:884
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/15
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:15
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54