dev-master
9999999-devCKEditor and KCFinder
GPL-3.0
The Requires
by Surakit Choodet
extension yii2
CKEditor and KCFinder
CKEditor and KCFinder, (*1)
CKEditor and KCFinder, (*2)
The preferred way to install this extension is through composer., (*3)
Either run, (*4)
composer require kuakling/yii2-keditor "*"
or add, (*5)
"kuakling/yii2-keditor": "*"
to the require section of your composer.json
file., (*6)
Once the extension is installed, simply use it in your code by :, (*7)
Convert textarea to CKEditor, (*8)
<?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, (*9)
<?php echo $form->field($model, 'icon')->widget( \kuakling\keditor\KCFinderTextInput::className(), [ 'dir' => 'icons' //sub directory of kcfinder upload directory ] )->label(false); ?>
CKEditor and KCFinder
GPL-3.0
extension yii2