400 likes | 580 Views
ColdFusion Basics. A goal properly set is halfway reached. Zig Ziggler. Perspective. Mystery Guest #1 Mystery Guest #2 Mystery Guest #3. The Evolution of a Developer. Different Approaches. AJAX (Browser). AIR (Desktop w/Flex). Usability. Tags. Script. < cfscript >
E N D
ColdFusion Basics A goal properly set is halfway reached. ZigZiggler
Perspective Mystery Guest #1 Mystery Guest #2 Mystery Guest #3
Different Approaches AJAX (Browser) AIR (Desktop w/Flex)
Usability Tags Script <cfscript> ma = [1,3,5,22]; myTotal = 0; for(i=1;i<=arrayLen(ma);i++){ myTotal += ma[i]; } // writeOutput(myTotal); </cfscript> <cfoutput>#myTotal#</cfoutput> <cfset ma = [1,3,5,22]> <cfsetmyTotal = 0> <cfloop index=“i” from=“1” to=“#arrayLen(ma)#”> <cfsetmyTotal = myTotal + ma[i]> </cfloop> <cfoutput>#myTotal#</cfoutput>
Different Approaches Networking SOAP REST RSS Forms HTML (submit) AJAX (submit) PDF Application Frameworks CF on Wheels ColdBox Fusebox Machii Model Glue SOS(Flex/AIR) Cairngorm Mate PureMVC Switz
Different Approaches Methodologies Procedural Stand Alone Object Oriented Inversion of Control Libraries (Data CF) DataMgr Transfer (AJAX) EXTJS jQuery Moho Prototype Spry YUI
Variables • Simple Variable Types • “Text” • Numbers • Binary
Variables Lists
Variables Arrays
Variables Structures
Variables Recordsets (queries)
Variables XML
Loops List Loops
Loops Array Loops
Loops Recordset (query) Loops
Loops • while a = ArrayNew(1); loop = 1; while (loop LE 10) { a[loop] = loop * 5; loop = loop + 1; }
Loops • do … while a = ArrayNew(1); loop = 1; do { a[loop] = loop * 5; loop = loop + 1; } while (loop LE 10);
Loops • For Loops for ( loop=1; loop LE 10; loop = loop+1) { if(a[loop] EQ "") continue; WriteOutput(loop); } // continue skip to next loop start // break exit loop immediately
Loops • Structure Loops myStruct=StructNew(); myStruct.productName=“wheat flour"; mystruct.quality="fine"; myStruct.quantity=50; for (keyName in myStruct) { WriteOutput("myStruct." & Keyname & " has the value: " & myStruct[keyName] &"<br>"); }
Conditional Logic • if • else if • else
Conditional Logic • switch • case • defaultCase
Packaging • Include Files • Custom Tags • Custom Components (objects/CFCs)
Packaging • Include Files • Example: Layout Header / Footer
Packaging • Custom Tags • Example: Layout • Includes Header and Footer • Example: Custom Layout with Application Setting
Packaging • CFCs (custom components) • Example: Custom User • Login/Logout • Revise with DataMgr
Applications • Application • Session • Request
Applications • onApplicationStart() • onSessionStart() • onRequestStart() • onRequest() • onRequestEnd() • onSessionEnd() • OnApplicationEnd() • onError() • onMissingTemplate()
Applications • THIS.name • THIS.applicationTimeout • THIS.clientManagement • THIS.clientStorage • THIS.customTagPath • THIS.loginStorage • THIS.mappings • THIS.sessionManagement • THIS.sessionTimeout • THIS.setClientCookies • THIS.setDomainCookies • THIS.scriptProtect • THIS.secureJSON • THIS.secureJSONPrefix • THIS.welcomeFileList
What Else? • Learn SQL? • Application Frameworks • Library Frameworks
Resources • Books • CFWack 1 through 3 • ColdFusion 8 Developer Tutorial • Training and Knowledge Sites • Lynda.com • CommunityMX.com • Conferences (like this one)
Resources • blogs • Adobe Dev Center • User Groups • Forums
Resources • Popular CFML sites • Riaforge.org • cfMeetup • HouseOfFusion.com • Cflib.org
ColdFusion Basics A goal properly set is halfway reached. ZigZiggler