PHP code example of froala / wysiwyg-cake2
1. Go to this page and download the library: Download froala/wysiwyg-cake2 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/ */
froala / wysiwyg-cake2 example snippets
$this->Html->css('/Froala/css/froala_editor.min.css');
$this->Html->script('/Froala/js/froala_editor.min.js', array('toolbarInline' => false));
$this->Html->css('/yourapp/Froala/css/froala_editor.min.css');
$this->Html->script('/yourapp/Froala/js/froala_editor.min.js', array('toolbarInline' => false));
$this->Html->script(
array(
'/Froala/js/froala_editor.min.js',
'/Froala/js/plugins/align.min.js',
'/Froala/js/plugins/char_counter.min.js',
'/Froala/js/plugins/code_beautifier.min.js',
'/Froala/js/plugins/code_view.min.js',
'/Froala/js/plugins/colors.min.js',
'/Froala/js/plugins/draggable.min.js',
'/Froala/js/plugins/emoticons.min.js',
'/Froala/js/plugins/entities.min.js',
'/Froala/js/plugins/file.min.js',
'/Froala/js/plugins/font_family.min.js',
'/Froala/js/plugins/font_size.min.js',
'/Froala/js/plugins/fullscreen.min.js',
'/Froala/js/plugins/help.min.js',
'/Froala/js/plugins/image.min.js',
'/Froala/js/plugins/image_manager.min.js',
'/Froala/js/plugins/inline_style.min.js',
'/Froala/js/plugins/line_breaker.min.js',
'/Froala/js/plugins/link.min.js',
'/Froala/js/plugins/lists.min.js',
'/Froala/js/plugins/paragraph_format.min.js',
'/Froala/js/plugins/paragraph_style.min.js',
'/Froala/js/plugins/print.min.js',
'/Froala/js/plugins/quick_insert.min.js',
'/Froala/js/plugins/quote.min.js',
'/Froala/js/plugins/save.min.js',
'/Froala/js/plugins/special_characters.min.js',
'/Froala/js/plugins/table.min.js',
'/Froala/js/plugins/url.min.js',
'/Froala/js/plugins/video.min.js'),
array('toolbarInline' => false)
);
$this->Html->css(
array(
'/Froala/css/froala_editor.min.css',
'/Froala/css/froala_style.min.css',
'/Froala/css/plugins/char_counter.min.css',
'/Froala/css/plugins/code_view.min.css',
'/Froala/css/plugins/colors.min.css',
'/Froala/css/plugins/draggable.min.css',
'/Froala/css/plugins/emoticons.min.css',
'/Froala/css/plugins/file.min.css',
'/Froala/css/plugins/fullscreen.min.css',
'/Froala/css/plugins/help.min.css',
'/Froala/css/plugins/image_manager.min.css',
'/Froala/css/plugins/image.min.css',
'/Froala/css/plugins/line_breaker.min.css',
'/Froala/css/plugins/quick_insert.min.css',
'/Froala/css/plugins/special_characters.min.css',
'/Froala/css/plugins/table.min.css',
'/Froala/css/plugins/video.min.css'
)
);
class AppController extends Controller
{
...
public $helpers = array('Froala.Froala');
...
}
<div class="selector">
<?= $this->Froala->editor('.selector');
Configure::write('Froala.editorOptions', array('height' => '300px'))
$this->Froala->editor('.selector', array('option' => value));