XF 1.5 How to call a template from a custom helper?

Chris D

XenForo developer
Staff member
You can see an example of this in XenForo_Template_Helper_Core::_getPageNav().
$template = new $templateClass($options['template'], $templateVariables);
$templateClass will be XenForo_Template_Public or XenForo_Template_Admin.


Active member
@Chris D Many Thanks, that worke like a charm!

I also got it worked like this, but it's bit of overkill :)

$res=new Zend_Controller_Response_Http();
$req=new Zend_Controller_Request_Http();
$dep=new XenForo_Dependencies_Public();

$vr = new XenForo_ViewRenderer_HtmlPublic($dep, $res, $req);

$content = $vr->renderView(