PHP code example of sparkinzy / dcat-kindeditor

1. Go to this page and download the library: Download sparkinzy/dcat-kindeditor library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

sparkinzy / dcat-kindeditor example snippets


       $afterUploadedCallback=JavaScript::make(
            <<<JS
function(data)
{
    var result = {};
    if (data.code === 0){
        result.error = 0;
        result.url = data.data.url;
    }else{
        result.error = data.code;
        result.message = data.msg;
    }
    return result;
}
JS
        );
        $custom_upload_url = 'http://upload.baidu.com/';
        $form->kindeditor('editor')->options(['afterUploaded'=>$afterUploadedCallback])->url($custom_upload_url);'




$form->kindeditor('desc')->url($custom_upload_url)->readonly();

$form->kindeditor('content')
// 在源代码后面新增一个 从Word粘贴
->appendToolbar('wordpaste','source')
// 添加一组栏目
->appendToolbar(['link','unlink'],'source')
// 在最后新增一个 插入百度地图
->appendToolbar('baidumap')
// 移除图片
->removeToolbar('insertimages');
// 删除多个项目
->removeToolbar(['justifyleft'])