百度编辑器的插入

下载编辑器地址 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 !!}
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • Android 自定义View的各种姿势1 Activity的显示之ViewRootImpl详解 Activity...
    passiontim阅读 173,620评论 25 708
  • 作为一个前端程序猿,下面这些站会让你眼前一亮。 amazeui框架组建丰富 http://amazeui.org...
    欧巴冰冰阅读 8,930评论 18 303
  • MyBatis 是支持定制化 SQL、存储过程以及高级映射的优秀的持久层框架。MyBatis 避免了几乎所有的 J...
    jianzuming阅读 589评论 0 0
  • 新年在各种祝福声中愉快来临,公司年终聚餐,告别了...
    fe3c86979609阅读 282评论 3 2
  • 昔临处暑,今近腊八,其间四月有余,未敢怠之。尽智竭力,愿学之有所示;劳神苦形,图锥之处囊中。 事从其师,远...
    常也无常阅读 176评论 4 0