WYSIWYG Editor

From PHPDevShell

Jump to: navigation, search

Instant WYSIWYG

PHPDevShell has TinyMCE support for instant WYSIWYG. It is very easy to setup or to customize to your liking.

WYSIWYG on the go

To get wysiwyg on a default configuration to convert your text area to a wysiwyg editor.

// Load and set code.
$wysiwyg = new wysiwyg();
$wysiwyg->wysiwyg_load();
 
// All following text areas will be converted now.

Advanced WYSIWYG support

PHPDevShell offers the developer a way to have custom TinyMCE configurations load per specific scripts and plugins. Meaning for example1.php you could have a single configuration for a specific text area only for instance.

Lets have a look at how this can be achieved. First of all, create a wysiwyg config file inside your plugins folder, lets copy the Default PHPDevShell wysiwyg config file as below example.

// Copy :
plugins/PHPDevShell/includes/config.advanced.wysiwyg.php
// To your plugin folder :
plugins/ExamplePlugin/includes/config.advanced.wysiwyg.php
// Rename the advanced to anything you like :
plugins/ExamplePlugin/includes/config.example.wysiwyg.php

Now that you have create the file lets call our advanced configuration now:

// Load and set code.
$wysiwyg = new wysiwyg();
$wysiwyg->wysiwyg_load('example');
 
// This will now load the config from your plugin folder as mentioned above.

Please see the TinyMCE documentation for advanced configuration.