kuakling/yii2-keditor

CKEditor and KCFinder

Installs: 48

Dependents: 1

Suggesters: 0

Security: 0

Stars: 1

Watchers: 1

Forks: 0

Open Issues: 1

Type:yii2-extension

dev-master 2016-04-18 07:39 UTC

This package is not auto-updated.

Last update: 2024-11-13 10:00:22 UTC


README

CKEditor and KCFinder Keditor

CKEditor and KCFinder

Installation

The preferred way to install this extension is through composer.

Either run

composer require kuakling/yii2-keditor "*"

or add

"kuakling/yii2-keditor": "*"

to the require section of your composer.json file.

Usage

Once the extension is installed, simply use it in your code by :

Convert textarea to CKEditor

<?php
//CKEditor
echo $form->field($model, 'detail')->widget(
  \kuakling\keditor\CKEditor::className(), 
  [
    'uploadDir' => '/var/www/public_html/UserFiles',
    'uploadURL' => '/UserFiles/',
    'filemanager'=>true, //true = enabled kcfinder, false = disabled kcfinder
    'preset'=>'full' //toolbar -> basic, standard, full
  ]
)->label(false); ?>
<?php
//TinyMce
echo $form->field($model, 'detail')->widget(
  \kuakling\keditor\TinyMce::className(), 
  [
    'uploadDir' => '/var/www/public_html/UserFiles',
    'uploadURL' => '/UserFiles/',
    'enableFilemanager' => true,
    'folderName' => ['file'=> 'File', 'image'=>'Image', 'media'=>'Media'],
  ]
); ?>

Using textinput choose file in server and return filename to textinput by CKFinder

<?php 
echo $form->field($model, 'icon')->widget(
  \kuakling\keditor\KCFinderTextInput::className(),
  [
    'dir' => 'icons' //sub directory of kcfinder upload directory
  ]
)->label(false);
?>