jamiejackson

Untitled

May 14th, 2012
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <cfcomponent >
  2.  
  3.  
  4. <cffunction name="saveFirstName" output="false" >
  5.     <cfargument name="firstName" type="string" required="true" />
  6.    
  7.     <cfdump var="#arguments#" label="arguments" /><cfabort>
  8.     <cfscript>
  9.  
  10.     local.out = {};
  11.     local.out.errors = {};
  12.     local.out.success = true;
  13.  
  14.     if (len(trim(arguments.firstName)) is 0) {
  15.    
  16.         local.out.errors.firstName = "Required.";
  17.         local.out.success = false;
  18.        
  19.     } else {
  20.    
  21.         // Here, we would call the model.
  22.        
  23.     }
  24.    
  25.     return local.out;
  26.     </cfscript>
  27.    
  28. </cffunction>
  29.  
  30. <cfscript>
  31.    
  32.     function saveLastName ( string name ) {
  33.    
  34.         // Here, we would call the model.
  35.        
  36.     }
  37.  
  38. </cfscript>
  39.  
  40. <cffunction name="OnMissingMethod" access="public" returntype="any" output="false" hint="Handles missing method exceptions.">
  41.     <cfargument name="MissingMethodName" type="string" required="true" hint="The name of the missing method." />
  42.     <cfargument name="MissingMethodArguments" type="struct" required="true" hint="The arguments that were passed to the missing method. This might be a named argument set or a numerically indexed set." />
  43.      
  44.     <cfdump var="#arguments#" label="Missing Method Arguments" />
  45.      
  46.     <cfabort />
  47.      
  48.     <cfreturn />
  49. </cffunction>
  50.  
  51. </cfcomponent>
Advertisement
Add Comment
Please, Sign In to add comment