Changes between Version 1 and Version 2 of QuickStart/2:ModellingourApplication
- Timestamp:
- 04/27/09 14:26:59 (17 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
QuickStart/2:ModellingourApplication
v1 v2 11 11 12 12 <cffunction name="init" returntype="any" access="public" output="false"> 13 <cfargument name="vowels" type="string" required="true" /> 13 14 14 <cfargument name="vowels" type="string" required="true"/>15 <cfset variables.vowels = arguments.vowels /> 15 16 16 <cfset variables.vowels = arguments.vowels /> 17 18 <cfreturn this /> 19 17 <cfreturn this /> 20 18 </cffunction> 21 19 22 20 <cffunction name="translate" returntype="string" access="public" output="false"> 21 <cfargument name="phrase" /> 23 22 24 <cfargument name="phrase" /> 23 <cfset var firstVowel = reFindNoCase("[#variables.vowels#]", arguments.phrase) - 1/> 24 <cfset var result = trim(arguments.phrase) /> 25 25 26 <cfset var firstVowel = reFindNoCase("[#variables.vowels#]", arguments.phrase) - 1/> 26 <!--- We started with a consonant ---> 27 <cfif len(result) and firstVowel gt 0> 28 <cfset result = right(arguments.phrase, len(arguments.phrase) - firstVowel) 29 & left(arguments.phrase, firstVowel) & "ay" /> 30 <!--- We started with a vowel ---> 31 <cfelseif len(result)> 32 <cfset result = result & "ay" /> 33 </cfif> 27 34 28 <cfset var result = trim(arguments.phrase) /> 29 30 <!--- We started with a consonant ---> 31 32 <cfif len(result) and firstVowel gt 0> 33 34 <cfset result = right(arguments.phrase, len(arguments.phrase) - firstVowel) & left(arguments.phrase, firstVowel) & "ay" /> 35 36 <!--- We started with a vowel ---> 37 38 <cfelseif len(result)> 39 40 <cfset result = result & "ay" /> 41 42 </cfif> 43 44 <cfreturn result /> 45 35 <cfreturn result /> 46 36 </cffunction> 47 37
![(please configure the [header_logo] section in trac.ini)](/ModelGlue.com/trac.cgi/chrome/site/your_project_logo.png)