thinkphp 对百度编辑器里的内容进行保存

模板代码

<!DOCTYPE HTML>
<html lang="en-US">

<head>
    <meta charset="UTF-8">
    <title>ueditor demo</title>
</head>

<body>
    <!-- 加载编辑器的容器 -->
    <script id="container" name="content" type="text/plain">
    
    </script>
    <!-- 配置文件 -->
    <script type="text/javascript" src="http://localhost/myapp/public/ueditor.config.js"></script>
    <!-- 编辑器源码文件 -->
    <script type="text/javascript" src="http://localhost/myapp/public/ueditor.all.js"></script>
    <!-- 实例化编辑器 -->
    

<form action="__URL__/insert" method="post" >
<textarea name="content" id="myEditor"></textarea>        
<script type="text/javascript">
    UE.getEditor('myEditor', {
    theme:"default", //皮肤
    lang:"zh-cn", //语言
    initialFrameWidth:800,  //初始化编辑器宽度,默认800
    initialFrameHeight:320
});
</script>
<input type="submit" value="提交">
</form>
</body>
</html>

控制器代码

public function insert(){
header("Content-Type:text/html; charset=utf-8"); 
     $Dao = M("admin");
     $Dao->create();
 $Dao->id='1';
 $Dao->user=htmlspecialchars($_POST['content']);
 $Dao->add();
 print_r($Dao);
    }

thinkphp整合ueditor(百度编辑器)方法

转载于:https://www.cnblogs.com/hellowzd/p/4096194.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值