YII中百度编辑器器的使用

来源:互联网 发布:windows和安卓平板 编辑:程序博客网 时间:2024/05/17 22:10

1.下载百度编辑器,解压到assets/super/下



<div class="row">            <div class="control-group ">                    <div class="control-label">                        <?php echo $form->labelEx($model,'pic_url'); ?>                    </div>                    <div class="controls">                        <?php echo $form->textArea($model,'pic_url'); ?>                        <?php echo $form->error($model,'pic_url'); ?>                    </div>                </div></div>



<!--**引入百度编辑器**-->    <!-- 配置文件 -->    <script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/assets/super/org/ueditor/ueditor.config.js"></script>    <!-- 编辑器源码文件 -->    <script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/assets/super/org/ueditor/ueditor.all.min.js"></script>    <!-- 实例化编辑器 -->    <script type="text/javascript">        window.UEDITOR_HOME_URL="<?php echo Yii::app()->request->baseUrl; ?>/assets/super/org/ueditor/";        //定义第一个编辑器        window.UEDITOR_CONFIG.initialFrameHeight=200;        window.UEDITOR_CONFIG.toolbars=[['simpleupload', 'insertimage']];        var editor1 = new baidu.editor.ui.Editor();        editor1.render( 'Pictures_pic_url');        window.UEDITOR_CONFIG.toolbars=[[            'fullscreen', 'source', '|', 'undo', 'redo', '|',            'bold', 'italic', 'underline', 'fontborder', 'strikethrough', 'superscript', 'subscript', 'removeformat', 'formatmatch', 'autotypeset', 'blockquote', 'pasteplain', '|', 'forecolor', 'backcolor', 'insertorderedlist', 'insertunorderedlist', 'selectall', 'cleardoc', '|',            'rowspacingtop', 'rowspacingbottom', 'lineheight', '|',            'customstyle', 'paragraph', 'fontfamily', 'fontsize', '|',            'directionalityltr', 'directionalityrtl', 'indent', '|',            'justifyleft', 'justifycenter', 'justifyright', 'justifyjustify', '|', 'touppercase', 'tolowercase', '|',            'link', 'unlink', 'anchor', '|', 'imagenone', 'imageleft', 'imageright', 'imagecenter', '|',            'simpleupload', 'insertimage', 'emotion', 'scrawl', 'insertvideo', 'music', 'attachment', 'map', 'gmap', 'insertframe', 'insertcode', 'webapp', 'pagebreak', 'template', 'background', '|',            'horizontal', 'date', 'time', 'spechars', 'snapscreen', 'wordimage', '|',            'inserttable', 'deletetable', 'insertparagraphbeforetable', 'insertrow', 'deleterow', 'insertcol', 'deletecol', 'mergecells', 'mergeright', 'mergedown', 'splittocells', 'splittorows', 'splittocols', 'charts', '|',            'print', 'preview', 'searchreplace', 'help', 'drafts'        ]];        //定义第二个编辑器        var editor2 = new baidu.editor.ui.Editor();        editor2.render( 'Pictures_pic_votes');    </script>



0 0
原创粉丝点击