Skip to content

Instantly share code, notes, and snippets.

Created April 16, 2014 12:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/1785f7bc2ed25a4f6edb to your computer and use it in GitHub Desktop.
Save anonymous/1785f7bc2ed25a4f6edb to your computer and use it in GitHub Desktop.
In the component's init:
Variables.Categories =
{ 'T1' : 'Beetle'
, 'T1C' : 'Beetle Cabrio'
...
, 'CO' : 'Corrado'
, 'MISC' : 'MISC'
};
Then the equivalent getVehicleCategories to what you have is just:
<cfreturn Variables.Categories[Arguments.vehicleID] />
(But obviously can include any additional logic, like StructKeyExists/etc, as required.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment