1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

xen:callback

Discussion in 'XenForo Development Discussions' started by Valhalla, Mar 29, 2014.

  1. Valhalla

    Valhalla Well-Known Member

    Can I use the <xen:callback> tag to fetch some changeable data if I pass two parameters (user id, node id)? Something like below. I may be using xen:array incorrectly.

    params="{xen:array 'userId={$visitor.user_id}','forumId={$forum.node_id}'}"

    PHP:
    public static function getStatus($params)
    {
       
    $userId $params['userId'];
       
    $forumId $params['forumId'];

       
    // return something
    }
     
  2. Valhalla

    Valhalla Well-Known Member

    Forget this thread. There is a better way.
     
  3. TBDragon

    TBDragon Active Member

    can u give me a link for that way ?!
     
  4. Valhalla

    Valhalla Well-Known Member

    I didn't use the callback tag. I passed what I needed through the viewParams variable.
     
    TBDragon likes this.
  5. TBDragon

    TBDragon Active Member

    is it possible to provide me some tips about this variable cuz i have to do something similar and pass many things and play with them in php
     
  6. Valhalla

    Valhalla Well-Known Member

    TBDragon likes this.
  7. thedude

    thedude Well-Known Member

    TBDragon likes this.
  8. robart

    robart Member

    Is there any documentation on xen:array? I can't seem to find any. I'm also trying to do something along the lines of:

    params="{xen:array 'userId={$visitor.user_id}','forumId={$forum.node_id}'}"

    within a <xen:callback>
     

Share This Page