### 下載ueditor放到項目中 [http://ueditor.baidu.com/website/](http://ueditor.baidu.com/website/)
`
~~~
/**
* @param array $params
* @return string
* @author: LuckyHhy <jackhhy520@qq.com>
* @date: 2020/3/19
* @name: build_ueditor
* @describe:百度編輯器內容
*/
function build_ueditor($params = array())
{
$name = isset($params['name']) ? $params['name'] : null;
$theme = isset($params['theme']) ? $params['theme'] : 'normal';
$content = isset($params['content']) ? $params['content'] : null;
/* 指定使用哪種主題 */
$themes = array(
'normal' => "[
'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', 'drafts', 'help'
]", 'simple' => " ['fullscreen', 'source', 'undo', 'redo', 'bold']",
);
switch ($theme) {
case 'simple':
$theme_config = $themes['simple'];
break;
case 'normal':
$theme_config = $themes['normal'];
break;
default:
$theme_config = $themes['normal'];
break;
}
/* 配置界面語言 */
switch (config('default_lang')) {
case 'zh-cn':
$lang = '/plugs/ueditor/lang/zh-cn/zh-cn.js';
break;
case 'en-us':
$lang = '/plugs/ueditor/lang/en/en.js';
break;
default:
$lang = '/plugs/ueditor/lang/zh-cn/zh-cn.js';
break;
}
$include_js = '<script type="text/javascript" charset="utf-8" src="/plugs/ueditor/ueditor.config.js"></script> <script type="text/javascript" charset="utf-8" src="/plugs/ueditor/ueditor.all.min.js""> </script><script type="text/javascript" charset="utf-8" src="' . $lang . '"></script>';
$content = json_encode($content);
$str = <<<EOT
$include_js
<script type="text/javascript">
var ue = UE.getEditor('{$name}',{
toolbars:[{$theme_config}],
});
if($content){
ue.ready(function() {
this.setContent($content);
})
}
</script>
EOT;
return $str;
}
}
~~~
`
- 空白目錄
- thinkphp5
- tools-常用類庫
- redis類庫
- Excel類庫
- File文件操作類庫
- Http請求類庫
- Maile郵件發送
- Hooks行為鉤子
- 七牛云
- 隨機數和字符串生成
- 字符串處理
- 時間類處理
- tree型轉換
- 工具類庫
- 文件打包下載
- 常用功能
- 文件上傳
- php生成word文檔
- elasticsearch 基本搜索
- 使用jwt開發API接口
- 安裝模及搭建
- ApiCheck.php
- ApiCheckLogin.php
- common.php
- Login.php
- Comment.php
- 漢字轉拼音
- 安裝使用
- Pinyin類
- elasticsearch操作
- 常用方法
- 數據源生成layui-select
- 獲取自定義配置項
- 百度編輯器
- 格式化文件大小
- 多語言設置
- hook監聽
- 域名綁定到模塊
- thinkphp6
- 文件上傳
- tp5totp6
- 創建路徑
- 獲取類所有方法
- password_hash加密驗證
- 生成 qrcode
- 郵件發送
- 獲取QQ信息
- GoogleAuthenticator
- redis限流
- redis 加鎖
- 百度翻譯
- QueryList爬取數據
- 獲取時間類
- 命令
- Git常用命令
- easyswoole
- pix_qrcode
- 驗證 cpf,cnpj
- php常用方法
- 日志
- 卡通頭像
- 兩位小數
- 圖片轉base64
- auth加密解密
- phpoffice/phpspreadsheet導入導出
- fastadmin
- 樹結構
- 單選框
- 復選框
- 二級搜索
- select選擇框
- selectpage選中回調事件
- 標簽添加
- 修改where條件
- 表格列表中添加input框
- selectpage事件
- fieldlist
- js操作
- test_js
- 多表格
- template模板