CKEditor5 + ckfinder3(php)
CKEditor5资源下载,这里我们选择ckeditor5-build-classic下载:
https://ckeditor.com/ckeditor-5-builds/download/
ckfinder3选择PHP版本下载:
https://ckeditor.com/ckeditor-4/download/#ckfinder
CKEditor5安装前请注意,我发现IE11浏览器有可能是不支持CKEditor5的,调试浏览器最好是用最新版本的火狐。
CKEditor5快速安装方法:
https://docs.ckeditor.com/ckeditor5/latest/builds/guides/quick-start.html#classic-editor
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CKEditor 5 - Classic editor</title>
<script src="https://cdn.ckeditor.com/ckeditor5/10.0.0/classic/ckeditor.js"></script>
</head>
<body>
<h1>Classic editor</h1>
<textarea name="content" id="editor">
<p>This is some sample content.</p>
</textarea>
<script>
ClassicEditor
.create( document.querySelector( '#editor' ) )
.catch( error => {
console.error( error );
} );
</script>
</body>
</html>
上边的代码保存example.html,放到网站根目录下运行。
ClassicEditor is not defined
如果辑编器不出现,并且在console中有这个错误提示,证明你的浏览器不支持ckeditor5,请用最新版本的火狐。
没有上述的问题,把<script src="https://cdn.ckeditor.com/ckeditor5/10.0.0/classic/ckeditor.js"></script>换成本地链接就好。
ckfinder安装方法:
把ckfinder解压后,放到网站根目录下。
打开http://localhost/ckfinder/ckfinder.html
会出现如下提示:
The file browser is disabled for security reasons. Please contact your system administrator and check the CKFinder configuration file.
打开ckfinder/config.php
把false改成true,保存。
$config['authentication'] = function () {
return true;
};
再次访问http://localhost/ckfinder/ckfinder.html
正常显示,测试上传图片功能是否正常。
注意:上传图片不要带中文汉字,全改成英文或数字,不然会造成乱码,不能返回图片。
更改上传文件路径
$config['backends'][] = array(
'name' => 'default',
'adapter' => 'local',
'baseUrl' => '/ckfinder/userfiles/',
// 'root' => '', // Can be used to explicitly set the CKFinder user files directory.
'chmodFiles' => 0777,
'chmodFolders' => 0755,
'filesystemEncoding' => 'UTF-8',
);
'baseUrl' => '/ckfinder/userfiles/',这个自定义上传图片路径,更改这里即可。
CKEditor5+ckfinder(php)结合解决方法:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CKEditor 5 - Classic editor</title>
<script src="/ckeditor/ckeditor.js"></script>
<script src="/ckeditor/translations/zh-cn.js"></script>
</head>
<body>
<h1>Classic editor</h1>
<textarea name="content" id="editor" rows="10">
<p>This is some sample content.</p>
</textarea>
<script type="text/javascript">
ClassicEditor
.create( document.querySelector( '#editor' ), {
//工具栏,可选择添加或去除
//toolbar: ['headings', 'bold', 'italic', 'blockQuote', 'bulletedList', 'numberedList', 'link', 'ImageUpload', 'undo'],
//editor加载中文简体,默认是英文
language: 'zh-cn',
ckfinder: {
uploadUrl: '/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images&responseType=json'
}
}
)
.catch( error => {
console.error( error );
} );
</script>
</body>
</html>
CKEditor5,ckfinder减肥(可忽略)
由于下载的文件中带有一些用不上的语言包和案例,为了减少空间,可以把这些文件删除
CKEditor5删除文件:
删除\ckeditor\LICENSE.md
删除\ckeditor\README.md
保留\ckeditor\translations下只留用得上的语言包,其他删除。比如我,只留一个zh-cn.js
ckfinder删除文件:
删除\ckfinder\samples
删除\ckfinder\userfiles //如果不更改上传图片路径,这个保留不册
删除\ckfinder\CHANGELOG.html
删除\ckfinder\ckfinder.html
删除\ckfinder\LICENSE.html
删除\ckfinder\README.html
删除\ckfinder\lang下只留用得上的语言包,其他删除。比如我,只留一个zh-cn.json
ckeditor5+ckfinder(php)整合下载,本人测试直接在网页上下载是失败的,请用迅雷,虽然慢点,但好歹也可以下载。
下载地址:https://files.cnblogs.com/files/iasnsqt/ckeditor-ckfinder.rar
总结:注意浏览器是否兼容ckeditor5,还有ckeditor和ckfinder路径问题。
CKEditor5 + ckfinder3(php)的更多相关文章
- CKEditor5 + vue2.0 自定义图片上传、highlight、字体等用法
因业务需求,要在 vue2.0 的项目里使用富文本编辑器,经过调研多个编辑器,CKEditor5 支持 vue,遂采用.因 CKEditor5 文档比较少,此处记录下引用和一些基本用法. CKEdit ...
- ckeditor5 安装高亮,颜色插件
ckeditor5 安装高亮插件 1.准备 git clone -b stable https://github.com/ckeditor/ckeditor5-build-classic.git cd ...
- ckeditor5 增加居中alignment
https://ckeditor.com/docs/ckeditor5/latest/builds/guides/integration/installing-plugins.html 克隆下来 gi ...
- CKEditor5 基本使用
1.引入 <script type="text/javascript" src="/plugin/ckeditor5/ckeditor.js">&l ...
- ckeditor5富文本编辑器在vue中的使用
安装依赖: npm install --save @ckeditor/ckeditor5-vue @ckeditor/ckeditor5-build-classic 要创建编辑器实例,必须首先将编辑器 ...
- CKEditor5 使用第二天 获取回传数据,图片上传
1.当系统中存在编辑功能时,需要将数据库中数据回显到页面,因此采用了最一般的方法,通过隐藏的input标签存贮,在通过CkEditor5中的setData方法将数据赋值到富文本框中 <texta ...
- CKEditor5 输入文字时拼音和汉字同时输入问题
在使用 CKEditor5 + vue 时,出现输入文字时,拼音和文字一起输入到编辑器到问题.与之前项目中使用 ckeditor 的区别是,这次项目是在 python 架构下局部引入 ckeditor ...
- Ckeditor5显示css样式
Ckeditor5在编辑模式是通过js加载样式的,但是在显示时没有提供,官方提供了两种方式来实现. https://ckeditor.com/docs/ckeditor5/latest/builds/ ...
- ckeditor5字体颜色,字体背景颜色设置显示
在config.js中添加相关代码: config.allowedContent=true;//关闭标签过滤, config.colorButton_enableAutomatic = true; c ...
随机推荐
- Tomcat内核之类加载器工厂
Java虚拟机利用类加载器将类载入内存,以供使用.在此过程中类加载器要做很多的事情,例如读取字节数组.验证.解析.初始化等.而Java提供的URLClassLoader类能方便地将jar.class或 ...
- Java基础---Java---网络编程---TCP、UDP、UDP-键盘录入方式数据、Socket、TCP复制文件、UDP-聊天
网络编程 网络模型 *OSI参考模型 *Tcp/IP参考模型 网络通读要素 *IP地址 *端口号 *传输协议 1.找到对方Ip 2.数据要发送到对方指定的的应用程序上,为了标识这些应用程序,所经给这些 ...
- 深入浅出Java Dom4j读取XML
在以前自己使用的xml较少,只是了解其很强大,现在可算是在DRP中,真正的开始使用它了,以前只是简单的理解xml,xml即可扩展标记语言,简单的使用,具体是什么?怎么用?还是一直让自己期待的. 首先来 ...
- UNIX环境高级编程——线程和fork
当线程调用fork时,就为子进程创建了整个进程地址空间的副本.子进程通过继承整个地址空间的副本,也从父进程那里继承了所有互斥量.读写锁和条件变量的状态.如果父进程包含多个线程,子进程在fork返回以后 ...
- Android Studio查看应用数字签名-android学习之旅(76)
Android Studio和Eclispe还是有比较大的区别,在这地方,eclipse可以直接在设置里面,而AS就需要通过Terminal来查看 步骤 1.首先定位到.android 一般都是在C盘 ...
- android自定义组件的简易实现
写这篇博客是为了复习之前在慕课上面有幸看到的自定义组件的实现,原理很简单,有三个步骤, 为自定义的组件做好声明:封装成具体的可以使用的组件类,并利用接口回调机制为其注册监听函数:想使用正常的组件的方式 ...
- Unity UGUI图文混排源码(一)
Unity UGUI图文混排源码(一):http://blog.csdn.net/qq992817263/article/details/51112304 Unity UGUI图文混排源码(二):ht ...
- STL字符串常用方法扩展
前言 STL作为一个标准模版库,很多容器和算法都是很实用的,接口也相对比较友好,而且在实现上也比较轻量级.相对boost来说,要轻量得多,相对loki来说,使用的模版语法不会那么晦涩难懂,基本还是能看 ...
- 【翻译】对于Ext JS 5,你准备好了吗?
原文:Are You Ready for Ext JS 5? Ext JS 5:准备升级 对于Ext JS 5加入Sencha的大家庭,我们感到非常高兴!作为一个主要版本,在Ext JS 5引入了一堆 ...
- Java进阶(九)正则表达式
java正则表达式 序 由于项目中使用到了利用正则表达式进行表单的校验,回想一下正则表达式的内容,忘得也差不多了,俗话说:"温故而知新,可以为师矣".今天就简单的温故一下正则表达式 ...