Editor - Get html values

Editor - Get html values

by Christopher Schönfeldt -
Number of replies: 2

Hello,

I am using the new editor as mentioned here *click*

What I want:
I want to write a HTML text into this editor and save it to my field in the database.

How it behaves?
I can insert my HTML code and it will correct transformed in the clean view of the editor. As I click save, only the clear text will stored in my Database and not the HTML Code.

From the docs mentioned above

// content of editor 
 $messagetext = $fromform->entry['text'];  // this gives me the text without the html

 // format of content
$messageformat = $fromform->entry['format']; // result value is = 1


How to save the html code of the editor into my database?


Specs: 

  • Moodle 3.8+
  • Localhost
  • local plugin
In reply to Christopher Schönfeldt

Re: Editor - Get html values

by Christopher Schönfeldt -
Solved:
in lib.php
wrong:
$mform->setType('partnercompany', PARAM_TEXT);

right:
$mform->setType('partnercompany', PARAM_RAW);