要在thinkphp中加个在线编辑器 ,刚开始不懂是什么,然后就百度啊,找啊找,就看到有UEditor 等等,然后发现挺多人用的,就蛮去看了下 然后就试了试,只实现 标题 和文本内容,其他都没有处理。
感觉很不错 后面再慢慢了解
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>Ueditor</title>
<script type="text/javascript" src="__PUBLIC__/UEditor/ueditor.config.js"></script>
<script type="text/javascript" src="__PUBLIC__/UEditor/ueditor.all.js"></script>
<script type="text/javascript">
window.onload = function(){
UE.getEditor('content');
}
</script>
</head>
<body>
<form action="{:U('ContManage/getInfo')}" method="post">标题:<br/>
<input type="text" name="title"/><br/>
内容:<textarea id="content" name="content" style="width:700px;height:300px;"></textarea>
<input type="submit" value="提交"/>
</form>
</body>
</html>
<?php
class ContManageAction extends Action{
public function index(){
$this->display();
}
public function editor(){
$this->display();
}
public function getInfo(){
$data = array();
$data['title'] = $_POST['title'];
$data['content'] = $_POST['content'];
var_dump($data);
}
}
?>