dev-master
9999999-devAkkaCKEditor plugin for CakePHP
The Requires
- php >=5.4
The Development Requires
AkkaCKEditor plugin for CakePHP
A CakePHP 3.x Plugin to allow the integration of CKEditor into an application., (*1)
composer.json
located in the root of your application, in the require
section . ie. /var/www/domain.com/composer.json
"require": { "akkaweb/cakephp-ckeditor": "dev-master" }
sudo php composer.phar update
Note: if composer.phar
is not found, you need to install it. Follow CakePHP's documentation here -> http://book.cakephp.org/3.0/en/installation.html. Refer to Installing Cakephp section, (*3)
git clone git@github.com:akkaweb/AKKA-CakePHP-CKEditor-Plugin.git
, (*4)
https://github.com/akkaweb/AKKA-CakePHP-CKEditor-Plugin/archive/master.zip
, (*5)
Note: When installing with either manual download or Git Clone and CakePHP complains it cannot find the plugin, you need to add the plugin to vendor/cakephp-plugins.php
in the plugins
array [] --> 'AkkaCKEditor' => $baseDir . '/plugins/AkkaCKEditor/'
. If you are using composer, running php composer.phar dumpautoload
could be sufficient. If it does not work add the following to the "autoload"
section in the root application's composer.json
file in the "psr-4":
section: "AkkaCKEditor\\": "./plugins/AkkaCKEditor/src"
, (*6)
bootstrap.php
file:Plugin::load('AkkaCKEditor', ['bootstrap' => false, 'routes' => true]);
AppController.php
class AppController extends Controller{ public $helpers = ['AkkaCKEditor.CKEditor']; }
class AppController extends Controller { public $helpers = ['AkkaCKEditor.CKEditor' => [ 'version' => '4.4.7', // Default Option 'distribution' => 'full' // Default Option / Other options => 'basic', 'standard', 'standard-all', 'full-all' ]]; }
<?php echo $this->CKEditor->loadJs(); ?>
inside the application default.ctp
file right before </head>
tag. This will allow CKEditor to be available througout the application. It can also be loaded inside the template file as the first line or before the textarea
where you want to apply the CKEditor. Insert the following code immediately after the textarea you want CKEditor applied, (*7)
// replace(field-name) -> replace takes field_name and can be used multiple times throughout your application <?php echo $this->Form->input('body'); ?> // Example <?php echo $this->CKEditor->replace('body'); ?>
Although we have done many tests to ensure this plugin works as intended, we advise you to use it at your own risk. As with anything else, you should first test any addition to your application in a test environment. Please provide any fixes or enhancements via issue or pull request., (*8)
AkkaCKEditor plugin for CakePHP