this scope in plugin cfc

1 view
Skip to first unread message

Sameer Gupta

unread,
Nov 25, 2009, 1:43:00 PM11/25/09
to ColdFusion on Wheels
hello,

i am unable use this scope in a plugin i am creating. may be i am
doing it wrong. i am getting an error when returning a variable using
cfreturn when called from my cfc. but if i call the function from my
view it works fine.

init function:

this.fontDirectory = expandPath("files/fonts/");


somewhere else in the cfc:

<cfset dir = getFontDirectory() /> ...... this calls the
getFontDirectory function in my CFC.


getFontDirectory function:

<cfreturn this.fontDirectory /> ...... error occurs here when called
from the line above.

but when i call getFontDirectory from view error doesn't occur. I use
the following syntax:
wheels.application.plugins.myplugin.getFontDirectory()


can somebody tell me what i am doing wrong.


best
sameer

Per Djurner

unread,
Nov 26, 2009, 9:28:28 AM11/26/09
to cfwh...@googlegroups.com
It all depends on how you are telling Wheels to inject the methods.
If you tell it to inject a method it won't be able to access the this scope anymore when called from within the Wheels context since only the method has been moved, not the rest of the component.


--

You received this message because you are subscribed to the Google Groups "ColdFusion on Wheels" group.
To post to this group, send email to cfwh...@googlegroups.com.
To unsubscribe from this group, send email to cfwheels+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/cfwheels?hl=en.



Reply all
Reply to author
Forward
0 new messages