Probably not the smartest question, but just want to be sure.

I'm building a cfc, and one of the functions is 'getPhoto'. The function
itself only needs to be provided a photo_id, and will use that to query a
bunch of related photo data that can then be used to display the photo,
etc.

Do I need to declare a variable for each value I expect to be returned? I
only need a single argument (photo id), but I might have 15 variables
returned (photo url, filename, created date, caption, etc). Is this what
gets put in the <cfreturn> block?

For instance, the query would generate a variable of queryName.photo_url.
Do I need to set a value of 'getPhoto.photo_url' = queryName.photo_url so
that when I want to actually use that value I don't have to use the
variable name that the query generated? Does this make sense?




On Thu, Mar 15, 2012 at 3:23 PM, Matthew Woodward <[email protected]>wrote:

> On Thu, Mar 15, 2012 at 1:20 PM, Jason Allen <[email protected]>wrote:
>
>> I'm unclear on how to initialize this. What folder should I place this
>> in? Does it matter?
>
>
> Nope.
>
>
>> I want these functions to be available globally.
>> Can I add this via OpenBD admin page? I'm not seeing anywhere there to
>> initialize it.
>>
>
> One way is in OnApplicationStart() in Application.cfc you just create an
> instance of this CFC and put it in the application scope. There's nothing
> in the admin or configuration that would relate to this. It's just basic
> CFC instantiation stuff:
>
> <cfset Application.photoService =
> CreateObject('component','dot.path.to.PhotoService') />
> --
> Matthew Woodward
> [email protected]
> http://blog.mattwoodward.com
> identi.ca / Twitter: @mpwoodward
>
> Please do not send me proprietary file formats such as Word, PowerPoint,
> etc. as attachments.
> http://www.gnu.org/philosophy/no-word-attachments.html
>
> --
> online documentation: http://openbd.org/manual/
> google+ hints/tips: https://plus.google.com/115990347459711259462
> http://groups.google.com/group/openbd?hl=en
>

-- 
online documentation: http://openbd.org/manual/
   google+ hints/tips: https://plus.google.com/115990347459711259462
     http://groups.google.com/group/openbd?hl=en

Reply via email to