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

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

Chris D

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

sajal

Active member
#3
@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(
'XenForo_ViewPublic_Base',
$viewParams,
'helper_products'
);