init
- 框架初始化 - 安装插件 - 修复PHP8.4报错
This commit is contained in:
48
addons/summernote/Summernote.php
Normal file
48
addons/summernote/Summernote.php
Normal file
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
namespace addons\summernote;
|
||||
|
||||
use think\Addons;
|
||||
|
||||
/**
|
||||
* Summernote富文本编辑器
|
||||
*/
|
||||
class Summernote extends Addons
|
||||
{
|
||||
|
||||
/**
|
||||
* 插件安装方法
|
||||
* @return bool
|
||||
*/
|
||||
public function install()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 插件卸载方法
|
||||
* @return bool
|
||||
*/
|
||||
public function uninstall()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $params
|
||||
*/
|
||||
public function configInit(&$params)
|
||||
{
|
||||
$config = $this->getConfig();
|
||||
$params['summernote'] = [
|
||||
'classname' => $config['classname'] ?? '.editor',
|
||||
'height' => $config['height'] ?? 250,
|
||||
'minHeight' => $config['minHeight'] ?? 250,
|
||||
'placeholder' => $config['placeholder'] ?? '',
|
||||
'followingToolbar' => $config['followingToolbar'] ?? 0,
|
||||
'airMode' => $config['airMode'] ?? 0,
|
||||
'toolbar' => (array)json_decode($config['toolbar'] ?? '', true),
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user