Skip to content

mbv/yii2-ckeditor-widget

 
 

Repository files navigation

CKEditor Widget for Yii2

Latest Version Software License Build Status Coverage Status Quality Score Total Downloads

Renders a CKEditor WYSIWYG text editor plugin widget.

Installation

The preferred way to install this extension is through composer.

Either run

composer require 2amigos/yii2-ckeditor-widget:~1.0

or add

"2amigos/yii2-ckeditor-widget" : "~1.0"

to the require section of your application's composer.json file.

Skins & Plugins

This widget works with default's dev-full/stable branch of CKEditor, with a set of plugins and skins. If you wish to configure a different skins or plugins that the one proposed, you will have to download them separately and configure the widget's clientOptions attribute accordingly.

Usage

The library comes with two widgets: CKEditor and CKEditorInline. One is for classic edition and the other for inline editing respectively.

Using a model with a basic preset:


use dosamigos\ckeditor\CKEditor;


<?= $form->field($model, 'text')->widget(CKEditor::className(), [
        'options' => ['rows' => 6],
        'preset' => 'basic'
    ]) ?>

Using inline edition with basic preset:


use dosamigos\ckeditor\CKEditorInline;

<?php CKEditorInline::begin(['preset' => 'basic']);?>
    This text can be edited now :)
<?php CKEditorInline::end();?>

Testing

To test the extension, is better to clone this repository on your computer. After, go to the extensions folder and do the following (assuming you have composer installed on your computer):

$ composer install --no-interaction --prefer-source --dev

Once all required libraries are installed then do:

$ vendor/bin/phpunit

Further Information

Please, check the CKEditor plugin site documentation for further information about its configuration options.

Contributing

Please see CONTRIBUTING for details.

Credits

License

The BSD License (BSD). Please see License File for more information.

2amigOS!
Web development has never been so fun!
www.2amigos.us

About

CKEditor WYSIWYG widget for Yii2.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • HTML 37.9%
  • JavaScript 33.3%
  • CSS 24.7%
  • PHP 4.1%