您当前的位置: 首页 >  编辑器

暂无认证

  • 4浏览

    0关注

    92582博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

tp6安装百度编辑器

发布时间:2022-05-22 12:11:56 ,浏览量:4

链接:http://localhost:8000/admin/index/index 第一步:使用phpstudy,指向。项目的根目录。

composer create-project topthink/think myProject
composer require topthink/think-multi-app

设置admin应用:

php think build admin

安装视图

composer require topthink/think-view

在phpstudy中的composer界面化工具中输入

php think run

在这里插入图片描述链接:http://localhost:8000/admin/index/index

安装百度编辑器插件

composer require bingher/ueditor

百度编辑器数据库:

php think ueditor:publish
php think migrate:run

设置视图路径:

'tpl_replace_string' => [ '__STATIC__' => '/static', '__ADMIN__' => '/static/admin', ], 

在这里插入图片描述

控制器:

 public function index() { return View::fetch('index'); } } 

视图:

<!DOCTYPE html> <html lang="zh-cn"> <head> <meta charset="UTF-8"> <title>Document</title> </head> <body> <script id="editor" type="text/plain" style="width:1024px;height:500px;"></script> <script type="text/javascript" charset="utf-8" src="__STATIC__/bingher/ueditor/ueditor.config.js"></script> <script type="text/javascript" charset="utf-8" src="__STATIC__/bingher/ueditor/ueditor.all.js"> </script> <!--建议手动加在语言,避免在ie下有时因为加载语言失败导致编辑器加载失败--> <!--这里加载的语言文件会覆盖你在配置项目里添加的语言类型,比如你在配置项目里配置的是英文,这里加载的中文,那最后就是中文--> <script type="text/javascript" charset="utf-8" src="__STATIC__/bingher/ueditor/lang/zh-cn/zh-cn.js"></script> <script type="text/javascript"> //实例化编辑器 //建议使用工厂方法getEditor创建和引用编辑器实例,如果在某个闭包下引用该编辑器,直接调用UE.getEditor('editor')就能拿到相关的实例 var ue = UE.getEditor('editor'); </script> </body> </html> 

在这里插入图片描述

关注
打赏
1653961664
查看更多评论
立即登录/注册

微信扫码登录

0.4069s