S sajal Active member Oct 3, 2017 #1 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?
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?
Chris D XenForo developer Staff member Oct 3, 2017 #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.
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.
S sajal Active member Oct 3, 2017 #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' );
@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' );