How to use a xenForo variable within my own class

mungo

New member
I've built a simple add-on and code event listener based on the tutorial.

it works fine if i just want to replace some text (yes i know i can do this with phrases) however it doesn't when the replace alo includes a xenForo phrase (or variable for that matter).

what i am trying to do is actually add a title tag to the link back to my homepage.

here is my current code:

class Mungo_listener
{
public static function templateHook($hookName, &$contents, array $hookParams, XenForo_Template_Abstract $template)
{
if($hookName == 'footer_links')
{
$contents = str_replace('>{xen:phrase home',' title="here is a friendly title">{xen:phrase home',$contents);
}
}
}

so two questions, how can i do this by the method i'm trying.
and
would there be a better way of doing this?
 
Top Bottom