fastadmin的每一个插件目录下都有一个config.php文件,存放的是该插件的参数配置。按照官方说明这些config.php中的值在fastadmin内的任何地区都能够运用get_addon_config(‘插件文件夹名’)来获取。
例如说咱们有个插件nkeditor,其config.php文件的内容为: <?php
return [
[
name => classname,
title => 渲染文本框元素,
type => string,
content => [],
value => .editor,
rule => required,
msg => ,
tip => 用于对指定的元素渲染,通常状况下无需修改,
ok=> ,extend => ,
],
[
name => theme,
title => 编辑器主题,
type => select,
content => [
default => 经典主题,
black => 雅黑主题,
blue => 淡蓝主题,
grey => 深灰主题,
primary => 深绿主题,
],value => black,
rule => required,
msg => ,
tip => ,
ok => ,
extend => ,
],
[
name => formulapreviewurl,
title => 数学公式预览URL,
type => string,
content=> [],value => https://math.now.sh?from={latex},
rule => ,
msg => ,
tip => 用于渲染数学公式的URL,
ok => ,
extend => ,
],
[
name => wordimageserver,
title => 启用word照片替换服务器,
type => radio,
content => [
1 => 是,
0 => 否,
],
value => 0,
rule => required,
msg => ,
tip => 倘若启用,请务必先运行word.exe,
ok => ,
extend => ,
],
[
name => attachmentmode_admin,
title => 管理员附件选取模式,
type => select,
content => [
all => 任何管理员均能够查看所有上传的文件,
auth => 仅能够查看自己及所有子管理员上传的文件,
personal => 仅能够查看选取自己上传的文件,
],
value => all,
rule => required,
msg => ,
tip => ,
ok => ,
extend => ,
],
[
name => attachmentmode_index,
title => 前台附件选取模式,
type => select,
content => [
all => 任何会员均可以查看所有上传的文件,
personal => 仅能够查看选取自己上传的文件,
],
value => personal,
rule => required,
msg => ,
tip => ,
ok => ,
extend => ,
],
];
倘若咱们要获取它的theme值,能够运用如下代码: $config = get_addon_config(nkeditor);
echo $config[theme];输出为: black
|