PHP code example of ryu818 / tiny-mce

1. Go to this page and download the library: Download ryu818/tiny-mce library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

ryu818 / tiny-mce example snippets


$this->Html->script('/TinyMCE/js/tiny_mce/tiny_mce.js', array('inline' => false);

$this->Html->script('/yourapp/TinyMCE/js/tiny_mce/tiny_mce.js', array('inline' => false);

$this->helpers = array('TinyMCE.TinyMCE');

$this->TinyMCE->editor(array('theme' => 'advanced', 'mode' => 'textareas'));

$configs = array(
		'simple' => array(
			'mode' => 'textareas',
			'theme' => 'simple',
			'editor_selector' => 'mceSimple'
		),
		'advanced' => array(
			'mode' => 'textareas',
			'theme' => 'advanced',
			'editor_selector' => 'mceAdvanced'
		)
);

$this->TinyMCE->configs = $configs;

Configure::write('TinyMCE.configs', array(
		'simple' => ...,
		'advanced' => ...));

$this->TinyMCE->editor('simple'); // This matches the 'simple' config name we passed in earlier.

Configure::write('TinyMCE.editorOptions', array('height' => '300px'))

		...
		
		echo $this->Html->script(array('https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js'));

		...

		echo $this->fetch('script');
	

		...
		
		echo $this->Html->script(array('jquery.min'));

		...

		echo $this->fetch('script');