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

Not a Bug xen:hook not passing $contents by ref

Discussion in 'Resolved Bug Reports' started by EasyTarget, Nov 7, 2011.

  1. EasyTarget

    EasyTarget Well-Known Member

    When using a simple template hook I noticed that $contents wasn't available.

    template member_view
    <xen:hook name="member_view_sidebar_middle1" params="{xen:array 'user={$user}'}" />

    and when I try to hook into it with
    public static function xenMoods_TemplateHook($hookName, &$contents, array $paramsXenForo_Template_Abstract $template)
            switch (
    "member_view_sidebar_middle1" :
    //do some stuff
    $contents =  $contents $somestuff;
    Looking at the debugger, the value of $contents was empty.
  2. Mike

    Mike XenForo Developer Staff Member

    $contents holds any contents within the hook tag or those added by other, umm, let's call them "users of hooks". I'm sure you can come up with an inappropriate name for them. :) In this case, there are no children to the hook.
    Jeremy likes this.

Share This Page