Add Redactor to my addon's textarea

Veryard

Member
Hello, I am working on a small addon, I am just wondering how would I be able to add redactor to my textarea for my addon?

Thanks!
 
You fetch it in your view class:
PHP:
<?php

class Dentel_Testimonials_ViewPublic_MyView extends XenForo_ViewPublic_Base
{
    public function renderHtml()
    {
        $this->_params['editorTemplate'] = XenForo_ViewPublic_Helper_Editor::getEditorTemplate(
            $this, 'message', $this->_params['defaultMessage']
        );
    }
}

And then in the template:
HTML:
    <fieldset>
        <dl class="ctrlUnit fullWidth surplusLabel">
            <dt><label for="ctrl_message">Message:</label></dt>
            <dd>{xen:raw $editorTemplate}</dd>
        </dl>
    </fieldset>
 
Back
Top Bottom