Integrating WysiwygPro into other PHP applications

WysiwygPro can be easily integrated into virtually any PHP application or website. With a few short lines of code, your WysiwygPro editor just works. And when you're done modifying your content, you can simply retrieve the HTML from $_POST using the name of the editor when you create it.

// Add the base WysiwygPro class code

// Create a new instance of WysiwygPro
$editor = new wysiwygPro();

// Give the editor a name which we will use to retrieve the finished content from $_POST
$editor->name = 'demoEditor';

// Display the editor with width and height parameters
$editor->display(800, 550);


That's all we need to build the WysiwygPro editor, just four lines of code. Of course, you can do more to affect the presentation and features of your editor in your site's PHP. See our advanced demos for a better idea of how you can alter the presentation of your editor in PHP.

Then once you're finished editing your content, your "Submit" or "Save" button pulls the HTML code from $_POST['demoEditor'] and saves it to the appropriate section of your website.

For this reason, WysiwygPro is very versatile. It can be used wherever you need to generate or modify content:

  • WysiwygPro is perfect for posting to your blog or company news feed.
  • If you have a forum, use WysiwygPro to unleash the creativity of your users. Just don't let them get too carried away.
  • Want your users to be able to write rich text emails from inside your website? If you've got the email protocol handled, WysiwygPro can take care of the formatting.
  • Your email newsletter will look great with WysiwygPro's style options.
  • If there's somewhere on your website where you think you might want an editor, but not all the time, WysiwygPro can be built dynamically using AJAX.