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

EasyTarget

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

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

and when I try to hook into it with
PHP:
public static function xenMoods_TemplateHook($hookName, &$contents, array $params, XenForo_Template_Abstract $template)
    {
        switch ($hookName)
        {
            case "member_view_sidebar_middle1" :
            {
                //do some stuff
                $contents =  $contents . $somestuff;
                break;
            }
        }
       
    }

Looking at the debugger, the value of $contents was empty.
 
$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.
 
Top Bottom