CakePHP Plugin for Froala Javascript WYSIWYG Text Editor. The editor is free only for non-commercial projects. For commercial applications you have to purchase a license from
JavaScript CSS PHP
Latest commit 8031ed9 Dec 9, 2016 @stefanneculai stefanneculai Update to V2.4.0.
Failed to load latest commit information.
Test/Case Update to V2.4.0. Dec 9, 2016
View/Helper Update to V2.4.0. Dec 9, 2016
webroot Update to V2.4.0. Dec 9, 2016
.editorconfig Travis tests. Feb 11, 2014
.gitignore First commit. Feb 11, 2014
.semver Travis tests. Feb 11, 2014
.travis.yml Remove PHP 5.2 from Travis. Feb 1, 2016
LICENSE.txt Update to 2.1.0. Feb 1, 2016 Update to V2.4.0. Dec 9, 2016
composer.json Update to V2.4.0. Dec 9, 2016

Froala WYSIWYG Editor Plugin for CakePHP Build Status

CakePHP Plugin for Froala Javascript WYSIWYG Text Editor. For cake 2.3+


The purpose of placing Froala WYSIWYG Editor in a plugin is to keep it separate from a themed view, the regular webroot or the app in general, which makes it easier to update and overall follows the idea of keeping the code clean and modular.


To use Froala WYSIWYG Editor you need to clone git repository:

git clone git:// Plugin/Froala

Or if your CakePHP application is setup as a git repository, you can add it as a submodule:

git submodule add git:// Plugin/Froala

Alternatively, you can download an archive from the master branch on Github and extract the contents to Plugin/Froala.


The Froala helper is basically just a convenience helper that allows you to use php and CakePHP conventions to generate the configuration for Froala and as an extra it allows you to load configs.

There two ways you can use this plugin, simply use the helper or load the editor "by hand" using

$this->Html->script('/Froala/js/froala_editor.min.js', array('toolbarInline' => false));

and placing your own script in the head of the page. Please note that the helper will auto add the Froala editor script to the header of the page. No need to to that by hand if you use the helper.

If your app is not set up to work in the top level of your host / but instead in /yourapp/ the automatic inclusion of the script wont work. You'll manually have to add the js file to your app:

$this->Html->script('/yourapp/Froala/js/froala_editor.min.js', array('toolbarInline' => false));

If you need to load the plugins, then use:


  array('toolbarInline' => false)


How to use the helper

Since CakePHP 2.0 it is necessary to activate the plugin in your application. To do so, edit app/Config/bootstrap.php and add the line CakePlugin::load('Froala'); at the bottom. If you already have CakePlugin::loadAll(); to auto-load all plugins then you may skip this step.

Wherever you want to use it, load it in the controller

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

In the view simply use the editor() method and pass options as key/value pairs in an array.

$this->Froala->editor('.selector', array('toolbarInline' => false));

This will instruct Froala to convert all matched elements on the page to Froala editors. If you require some more precise control, or want to change this behavior, checkout the Froala configuration options on the Froala website.

Default options

If you want a quick way to configure default values for all the Froala Editors of an application, you could use the 'Froala.editorOptions' configuration.

Here is an example of a line you could have in bootstrap.php:

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

It will make all editors to have a 300px height. You may want to override this value for a single editor. To do so, just pass the option to the editor() method and it will override the default value.

You can always check the tests to see how to use the helper.


  • PHP version: PHP 5.2+
  • CakePHP version: CakePHP 2.1+
  • jQuery javascript library

Dependency Note

This plugin depends on jQuery ( so you would need to ensure that it is loaded in your layout or the view in which you want to display your editor. An example of how to load jQuery in your layout is shown below:

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

Of course, you may also use a copy of the jQuery library from your app/webroot/js folder like this:

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

Also you should include the Font Awesome library so that the editor buttons work fine.


The wysiwyg-cake project is under MIT license. However, in order to use Froala WYSIWYG HTML Editor plugin you should purchase a license for it.

Froala Editor has 3 different licenses for commercial use. For details please see License Agreement.