2 Replies Latest reply on Oct 30, 2007 12:57 PM by cf_dev2

    cfinvoke equivalent needed

    ccsimmons Level 1
      My hosting company just killed access to the cfobject tag without warning. I have an application that invokes a component using cfobject and stores it in the SESSION scope. How can I use cfinvoke to accomplish the code that is attached? Or can I? Thanks!!! Code attached:

        • 1. Re: cfinvoke equivalent needed
          William_At_FAA Level 1
          I've never dealt with a shared environment before, so I'm not sure. But maybe they just disabled the tags and not the functions?

          You might be able to use the createObject() CFML function in place of the <cfobject> tag and then simply call functions as necessary without <cfinvoke> like so:

          <cfset myComponent.callSomeFunction(arg1=value1, arg2=value2) />

          Of course, if they've disabled object creation in general (including createObject()), you're boned. Hopefully they didn't.
          • 2. Re: cfinvoke equivalent needed
            cf_dev2 Level 1
            I don't know either. I would assume if you disable <cfobject> you disable createObject() as well, but its worth a shot.

            Don't know that it would work, but what about creating an init() method in your component. Then calling init() from cfinvoke. Totally untested ...

            <cffunction name="init" ...>
            <!--- return an instance of the component --->
            <cfreturn this />

            <cfinvoke component="path.to.yourcomponent" method="init" returnvariable="testObject" />

            <cfdump var="#testObject#" />