下载编辑器地址 ueditor.baidu.com
1.前端页面
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>完整demo</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<script type="text/javascript" charset="utf-8" src="{{ asset('utf8-php/ueditor.config.js') }}"></script>
<script type="text/javascript" charset="utf-8" src="{{ asset('utf8-php/ueditor.all.min.js') }}"> </script>
<!--建议手动加在语言,避免在ie下有时因为加载语言失败导致编辑器加载失败-->
<!--这里加载的语言文件会覆盖你在配置项目里添加的语言类型,比如你在配置项目里配置的是英文,这里加载的中文,那最后就是中文-->
<script type="text/javascript" charset="utf-8" src="{{ asset('utf8-php/lang/zh-cn/zh-cn.js') }}"></script>
<style type="text/css">
div{
width:100%;
}
</style>
</head>
<body>
<form action="testform" method="post">
<input type="hidden" name="_token" value="{{ csrf_token() }}">
<script id="editor" name="content" type="text/plain" style="width:760px;height:400px;"></script>
//这里的name='content' 就是你要插入数据库的字段的名字 ,这个id=editor就是下面实例化传参数的id var ue = UE.getEditor('editor');
<script type="text/javascript">
var ue = UE.getEditor('editor');
</script>
<style>
.edui-default{line-height: 28px;}
div.edui-combox-body,div.edui-button-body,div.edui-splitbutton-body
{overflow: hidden; height:20px;}
div.edui-box{overflow: hidden; height:22px;}
</style>
<button>ok</button>
</form>
</body>
</html>
在模板中读取的时候,要设置成不解析
{!! $about_data->us_profile !!}