码迷,mamicode.com
首页 > Web开发 > 详细

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

时间:2014-11-14 00:03:38      阅读:271      评论:0      收藏:0      [点我收藏+]

标签:style   blog   http   io   color   ar   os   sp   java   

模板代码

<!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(百度编辑器)方法

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

标签:style   blog   http   io   color   ar   os   sp   java   

原文地址:http://www.cnblogs.com/hellowzd/p/4096194.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!