代码初始化
This commit is contained in:
54
application/admin/command/Addon/stubs/addon.stub
Normal file
54
application/admin/command/Addon/stubs/addon.stub
Normal file
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
namespace addons\{%name%};
|
||||
|
||||
use app\common\library\Menu;
|
||||
use think\Addons;
|
||||
|
||||
/**
|
||||
* 插件
|
||||
*/
|
||||
class {%addonClassName%} extends Addons
|
||||
{
|
||||
|
||||
/**
|
||||
* 插件安装方法
|
||||
* @return bool
|
||||
*/
|
||||
public function install()
|
||||
{
|
||||
{%addonInstallMenu%}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 插件卸载方法
|
||||
* @return bool
|
||||
*/
|
||||
public function uninstall()
|
||||
{
|
||||
{%addonUninstallMenu%}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 插件启用方法
|
||||
* @return bool
|
||||
*/
|
||||
public function enable()
|
||||
{
|
||||
{%addonEnableMenu%}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 插件禁用方法
|
||||
* @return bool
|
||||
*/
|
||||
public function disable()
|
||||
{
|
||||
{%addonDisableMenu%}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
44
application/admin/command/Addon/stubs/config.stub
Normal file
44
application/admin/command/Addon/stubs/config.stub
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
[
|
||||
//配置唯一标识
|
||||
'name' => 'username',
|
||||
//显示的标题
|
||||
'title' => '用户名',
|
||||
//类型
|
||||
'type' => 'string',
|
||||
//分组
|
||||
'group' => '',
|
||||
//动态显示
|
||||
'visible' => '',
|
||||
//数据字典
|
||||
'content' => [
|
||||
],
|
||||
//值
|
||||
'value' => '',
|
||||
//验证规则
|
||||
'rule' => 'required',
|
||||
//错误消息
|
||||
'msg' => '',
|
||||
//提示消息
|
||||
'tip' => '',
|
||||
//成功消息
|
||||
'ok' => '',
|
||||
//扩展信息
|
||||
'extend' => ''
|
||||
],
|
||||
[
|
||||
'name' => 'password',
|
||||
'title' => '密码',
|
||||
'type' => 'string',
|
||||
'content' => [
|
||||
],
|
||||
'value' => '',
|
||||
'rule' => 'required',
|
||||
'msg' => '',
|
||||
'tip' => '',
|
||||
'ok' => '',
|
||||
'extend' => ''
|
||||
],
|
||||
];
|
||||
15
application/admin/command/Addon/stubs/controller.stub
Normal file
15
application/admin/command/Addon/stubs/controller.stub
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace addons\{%addon%}\controller;
|
||||
|
||||
use think\addons\Controller;
|
||||
|
||||
class Index extends Controller
|
||||
{
|
||||
|
||||
public function index()
|
||||
{
|
||||
$this->error("当前插件暂无前台页面");
|
||||
}
|
||||
|
||||
}
|
||||
7
application/admin/command/Addon/stubs/info.stub
Normal file
7
application/admin/command/Addon/stubs/info.stub
Normal file
@@ -0,0 +1,7 @@
|
||||
name = {%name%}
|
||||
title = 插件名称{%name%}
|
||||
intro = 插件介绍
|
||||
author = yourname
|
||||
website = https://www.fastadmin.net
|
||||
version = 1.0.0
|
||||
state = 1
|
||||
Reference in New Issue
Block a user