• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

cfinvoke equivalent needed

Explorer ,
Oct 30, 2007 Oct 30, 2007

Copy link to clipboard

Copied

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:

TOPICS
Advanced techniques

Views

407

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Oct 30, 2007 Oct 30, 2007

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Oct 30, 2007 Oct 30, 2007

Copy link to clipboard

Copied

LATEST
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 ...

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

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

<cfdump var="#testObject#" />

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation