简体   繁体   中英

Enable html in joomla editor

In one of my joomla custom form, I am rendering an editor as follows

<?php
        $qu=$question ? $question : '';
        $editor = JFactory::getEditor();
        echo $editor->display('question', $qu, '100%', '400', '80', '15');
?>

The editor was working fine But when I am trying to submit after formatting, its html part won't get sumitted. If the editor was loading from xml filter="safehtml" or filter="raw" will work. But how to enable html in this case ?

Please help Thanks in advance

The problem lies in JRequest::GET which by default strips all html.

You have to ask specifically the input you want html from.

JRequest::getVar( 'yourfieldname', '', 'post', 'string', JREQUEST_ALLOWHTML );

Joomla Docs

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM