Skip to main content
May 1, 2008
Question

Equivalent of createobject - cfinvoke

  • May 1, 2008
  • 2 replies
  • 383 views
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>
    This topic has been closed for replies.

    2 replies

    Inspiring
    May 1, 2008
    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/
    Inspiring
    May 1, 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