Render template from database?

How can I render (html & css) stored in the database, i.e. a template written by the user?

  1. How can I render it?
  2. How can I make sure that it is safe?
1 Like

Mostly you can’t, this is why it’s not really a good practice to accept HTML written by end users. Instead, provide some other end user templating mechanism.

2 Likes