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

sajal

Active member
I'm making a custom helper but I'm not able to find a method that I can use to call the view.. any ideas?
 
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.
 
@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'
);
 
Back
Top Bottom