• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Building Your First UDF

As a ColdFusion developer for Orange Whip Studios, you often need to display movie titles. It's easy enough to write a <cfquery> tag that retrieves the title for a particular movie based on its ID, but that can get repetitive if you need to do it on many different pages. Also, you must keep the database's design in mind at all times, instead of just concentrating on the task at hand.

You find yourself wishing you had a function called getFilmTitle() that would return the title of whatever FilmID you passed to it. So, for example, if you wanted to display the title of film number 8, you could just use this:


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint