Editor - Get html values

Editor - Get html values

ដោយ Christopher Schönfeldt នៅ
ចំនួនតប៖ 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
មធ្យមភាគនៃរង្វាយតម្លៃ: -
ឆ្លើយតបទៅកាន់ Christopher Schönfeldt

Re: Editor - Get html values

ដោយ Christopher Schönfeldt នៅ
Solved:
in lib.php
wrong:
$mform->setType('partnercompany', PARAM_TEXT);

right:
$mform->setType('partnercompany', PARAM_RAW);
មធ្យមភាគនៃរង្វាយតម្លៃ:Useful (1)
ឆ្លើយតបទៅកាន់ Christopher Schönfeldt

Re: Editor - Get html values

ដោយ Abhik Sharma នៅ

Very, Very thanks for it! ;)


មធ្យមភាគនៃរង្វាយតម្លៃ:Useful (1)