S4m'
Active member
Hello
I have a problem I try to display a preview of a custom editor and it gives me no return.
My action preview on my ControllerPublic
My renderHtml on my ViewPublic
My template preview
Thank you for your help
I have a problem I try to display a preview of a custom editor and it gives me no return.
My action preview on my ControllerPublic
PHP:
public function actionPreview()
{
$this->_assertPostOnly();
$message = $this->getHelper('Editor')->getMessageText('content', $this->_input);
$message = XenForo_Helper_String::autoLinkBbCode($message);
$viewParams = array(
'message' => $message
);
return $this->responseView('AddonCustoms_ViewPublic_Edit', 'Edit_preview', $viewParams);
}
My renderHtml on my ViewPublic
PHP:
class AddonCustoms_ViewPublic_Preview extends XenForo_ViewPublic_Base
{
public function renderHtml()
{
$bbCodeParser = XenForo_BbCode_Parser::create(XenForo_BbCode_Formatter_Base::create('Base', array('view' => $this)));
$this->_params['messageParsed'] = new XenForo_BbCode_TextWrapper($this->_params['content'], $bbCodeParser);
}
}
My template preview
HTML:
<div class="section">
<h3 class="subHeading">{xen:phrase preview}</h3>
<div class="messageText primaryContent baseHtml">{xen:raw $messageParsed}</div>
</div>
Thank you for your help