<?php
/**
 * Created by PhpStorm.
 * User: zw
 * Date: 17-12-3
 * Time: 下午21:05
 */


if (!function_exists('create_editor')) {
    function create_editor($id, $value = '', $config = array())
    {
        include_once "../public/resource/lib/Ckeditor/ckeditor.php";
        $CKEditor = new CKEditor('http://' . $_SERVER['HTTP_HOST'] . '/resource/lib/Ckeditor/');
        $_config['filebrowserBrowseUrl'] = '/resource/lib/Ckfinder/ckfinder.html';

        $_config['filebrowserImageBrowseUrl'] = '/resource/lib/Ckfinder/ckfinder.html?Type=Images';
        if (!empty($config)) {
            $_config = array_merge($_config, $config);
        }
        $CKEditor->editor("describe", $value, $_config);
    }
}