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

Equivalent of createobject - cfinvoke

Guest
May 01, 2008 May 01, 2008
I am hosting on Godaddy where they block the precious createobject function. Will this run

The previous statements were
Member = createObject("component","#Application.cfcRoot#.albums");
album=Member.Getalbum(url.album_id);

now they are
<cfinvoke component="#Application.cfcRoot#.albums" method="init" returnvariable="Member">
<cfscript>
album=Member.Getalbum(url.album_id);
</cfscript>
366
Translate
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
LEGEND ,
May 01, 2008 May 01, 2008
> Will this run

I think you're probably in a good position to try this for yourself and
see, aren't you? That's always my approach to see if something works:
trying it.

One question back at you: why have you got your album assignment station in
a <cfscript> block?

--
Adam
Translate
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
LEGEND ,
May 01, 2008 May 01, 2008
LATEST
in addition to Adam's comment:

in your 'previous' code you were not invoking any 'init' method of your
cfc. why are you invoking it in <cfinvoke> tag? do you have an 'init'
method in your cfc?

if my memory serves me well, porting your 'previous' 2 lines of code to
use cfinvoke can be done in one line with something like:

<cfinvoke component="#Application.cfcRoot#.albums" method="Getalbum"
name_of_you_Getalbum_function_argument_that_accepts_album_id="#url.album_id#"
returnvariable="album">

hth

Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/
Translate
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