Rendering Template in Static Function

Marcus

Well-known member
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:
$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) ""
}
 
Back
Top Bottom