Jump to content

[solved] Save description as HTML to database


Recommended Posts

I've already made a module that use TinyMCE to write the description, it runs nicely, but after submission, I notice that the HTML tags from tinyMCE are not saved to the database.

 

How to prevent the strip tags? Sorry for the bad english. Thanks

Link to comment
Share on other sites

Hi,

Are you saving it to the configuration table? If so, use Configuration::updateValue('valueName', $value, true);

 

 

The magic word here is "true" :)

 

No, it's not configuration I guess. Already solved by change

 

array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isString', 'required' => true)

 

into this

 

array('type' => self::TYPE_HTML,   'lang' => true, 'validate' => 'isCleanHtml', 'required' => true)

Link to comment
Share on other sites

thanks for confirmation, we thought that you want to put the html to the configuration table,

thanks for clarification now, you use object definition in your module, so it's necessary to use correc definition for the field

exactly as you show us above

 

thanks

 

im going to mark this topic as solved

 

regards

Link to comment
Share on other sites

  • 2 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...