HI Guys, quick question for you. I assume that you cannot use the
method getMyPlugin in a model serviceObject. How can I use this plugin
in the service object?
Inject it using the coldbox:myPlugin:{MyPlugin} DSL
You can inject it with the following DSL: "coldbox:myplugin:pluginname"
Or if you inject the controller reference, it would be controller.getMyPlugin("pluginname").
Same as core plugins really.
Thanks!
~Brad
Hi Curt,
I tried that using this syntax
<cfproperty name="fileUploader" inject="coldbox:myplugin"
scope="instance">
and calling it like this.
<cfset filename_header =
instance.fileuploader.uploadFile(path_header,'IMAGE') />
And the error says
Error Messages: Element FILEUPLOADER is undefined in a Java object of
type class [Ljava.lang.String;.
This is after restarting the server
Hi Curt working now with this change. Thanks for getting me on the
right path.
<cfproperty name="fileUploader" inject="coldbox:myplugin:fileUploader"
scope="instance">
<cfproperty name="fileUploader" inject="coldbox:myplugin:fileUploader "
scope="instance">
That should do it.
Curt