Ueditor使用方法,手把手教你
来源:互联网 发布:黑马程序员教程百度云 编辑:程序博客网 时间:2024/06/02 20:35
ueditor的使用方法:
第一步:引入
第二步:写表单
传到php里面的时候获取用name所带的值获取:本例htmlspecialchars($_POST['content'])获取。
第三步:实例化富文本,可以设置想要的工具,配置项里用竖线 '|' 代表分割线,如果分两行,则用[111,1,11],[222,2,222],这样写。
第四步:设置上传图片等等资源保存的路径,ueditor:上传文件保存路径设置:
D:\wamp64\www\TP\Public\utf8-php\php\config.json
"imagePathFormat": "/TP/Public/Upload/Image/{time}{rand:6}_{filename}", /* 上传保存路径,可以自定义保存路径和文件名格式 */
以下是完整实例:
第一步:引入
<!-- 配置文件 --><script type="text/javascript" src="ueditor.config.js"></script><!-- 编辑器源码文件 --><script type="text/javascript" src="ueditor.all.js"></script>
第二步:写表单
传到php里面的时候获取用name所带的值获取:本例htmlspecialchars($_POST['content'])获取。
<form action="server.php" method="post"><!-- 加载编辑器的容器 --><script id="container" name="content" type="text/plain">这里写你的初始化内容</script><input type="submit" value="提交"></form>
第三步:实例化富文本,可以设置想要的工具,配置项里用竖线 '|' 代表分割线,如果分两行,则用[111,1,11],[222,2,222],这样写。
<!-- 实例化编辑器 --><script type="text/javascript"> var ue = UE.getEditor('container', { toolbars: [ ['fullscreen', 'source', 'undo', 'redo', 'bold'] ], autoHeightEnabled: true, autoFloatEnabled: true });</script>
第四步:设置上传图片等等资源保存的路径,ueditor:上传文件保存路径设置:
D:\wamp64\www\TP\Public\utf8-php\php\config.json
"imagePathFormat": "/TP/Public/Upload/Image/{time}{rand:6}_{filename}", /* 上传保存路径,可以自定义保存路径和文件名格式 */
以下是完整实例:
<!DOCTYPE HTML><html lang="en-US"><head><meta charset="UTF-8"><title>ueditor demo</title><!-- 配置文件 --><script type="text/javascript" src="ueditor.config.js"></script><!-- 编辑器源码文件 --><script type="text/javascript" src="ueditor.all.js"></script></head><body><form action="server.php" method="post"><!-- 加载编辑器的容器 --><script id="container" name="content" type="text/plain">这里写你的初始化内容</script><input type="submit" value="提交"></form><!-- 实例化编辑器 --><script type="text/javascript"> var ue = UE.getEditor('container', { toolbars: [ ['fullscreen', 'source', 'undo', 'redo', 'bold'] ], autoHeightEnabled: true, autoFloatEnabled: true }); </script></body></html>
0 0
- Ueditor使用方法,手把手教你
- UEditor使用方法
- UEditor使用方法
- UEditor使用方法
- 手把手教你批处理
- 手把手教你做小抄
- 手把手教你申请专利
- 手把手教你ARC
- 手把手教你用动软
- 手把手教你用动软
- 手把手教你系列
- 手把手教你系列
- 手把手教你系列
- 手把手教你写批处理
- 手把手教你啤酒鸭
- 手把手教你写批处理
- 手把手教你写批处理
- 手把手教你写批处理
- play读取配置文件的方法
- 建造者模式
- 蓝桥杯-回文数
- kernel_mutex--mysql5.5.18
- 解决IDEA导入Myclipse项目的时候没有识别为Web项目的问题
- Ueditor使用方法,手把手教你
- android之MVP
- elk - kibana 显示red
- ueditor在chrome浏览器中,图片上传的弹框有很大的延迟,其他浏览器都正常
- HTML5和CSS3
- 如何在 Oracle Solaris 11 中配置网络
- Play framework Controllers控制器、action链式调用、返回的HTTP状态码
- IOS开发 - 网络&数据库功能综述
- C++本质:类的赋值运算符=的重载,以及深拷贝和浅拷贝