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

How to parse a content with a hook ?

Discussion in 'XenForo Development Discussions' started by Thibeault, Dec 31, 2015.

  1. Thibeault

    Thibeault Member


    I would like parse a content and display it in a template. But, i don't know how to do that with this code :
      $content .= $template->create('template_name', $params);
    How to add a view ?

  2. Jake B.

    Jake B. Well-Known Member

    Template hooks are deprecated as of 1.2 iirc. Best to use a template modification :)
  3. Thibeault

    Thibeault Member

    It's not my question. ;)
  4. Thibeault

    Thibeault Member

  5. wang

    wang Well-Known Member

    Inside your function that will hook into template hooks, you can use something like this.

    if($hookName == 'hookName')
    $varName 'code goes here that you want to parse';
    $myTemplate $template->create('template_name'$params);
    $contents .= $myTemplate;

    With this code you create your custom template and you have registered the $varName variable that you can use in your template like this. {$varName}.

Share This Page