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

Rendering Template in Static Function

Marcus

Well-known member
#1
PHP:
public static function noticesPrepare (
  array &$noticeList,
  array &$noticeTokens,
  XenForo_Template_Abstract $template,
  array $containerData
)  {}
I want to render the message in new created template notice_message. $this->responseview does not work as it is a static function and I am not in the controller anyway. This does not work as I do not know how to assign the result to a variable:

PHP:
  $responseView= new XenForo_ControllerResponse_View();
  //$responseView->viewName = $viewName;
  $responseView->templateName = 'post';
  //$responseView->params = array();
  //$responseView->containerParams = array();

Maybe you have an idea how to solve that?
 
Last edited:

Marcus

Well-known member
#2
$template->view123 = $responseView;

returns this

PHP:
["view123"] => object(XenForo_ControllerResponse_View)#488 (9) {
["viewName"] => string(0) ""
["templateName"] => string(7) "contact"
["params"] => array(0) {
}
["containerParams"] => array(0) {
}
["jsonParams"] => array(0) {
}
["subView"] => NULL
["responseCode"] => int(200)
["controllerName"] => string(0) ""
["controllerAction"] => string(0) ""
}