# Application module

# Directory structure

In this project/app/directory of the demo application, as thinkphp6 application more (opens new window) mode of presentation

├── controller                  # 控制器目录
├── model                       # 模型目录
├── view                        # 视图目录
├── common.php                  # 模块内公共文件
├── db_install.php              # 模块安装sql执行文件
├── db_uninstall.php            # 模块卸载sql执行文件
├── db_upgrade.php              # 模块升级sql执行文件
├── event.php                   # event     配置
├── icon.jpg                    # 模块图标   配置
├── manifest.xml                # 模块信息   配置
└── middleware.php              # middleware

# manifest.xml

Configure basic module information through the manifest.xml file

  1. identity Identifies the unique module
  2. version Indicates the version of a module. When a module is upgraded, the version parameter must be set synchronously
<?xml version="1.0" encoding="utf-8"?>
<manifest versionCode="">
	<application><!-- 应用基础配置-->
		<identity>demo</identity><!-- 应用标识与文件夹名称一致 -->
		<name>demo应用名称</name><!-- 应用名称-->
		<version>1.0.0</version><!-- 应用版本 -->
		<description>我的demo应用描述</description><!-- 简短的应用描述 -->
		<author>author</author><!-- 作者 -->

		<icon>icon.jpg</icon><!-- 应用目录下的图标名称,默认icon.jpg -->


		<!-- 【留空】默认点击应用进入模块菜单页-->
		<!-- 【自定义】配置管理后台入口路径后,将直接跳转到管理后台(无菜单页)<admin>/demo/admin/index</admin> -->
		<admin></admin>


	</application>


	<platform>

		<supports><!-- 支持的平台类型-->
				<item type="1" /><!-- 微信公众号-->
				<item type="2" /><!-- 微信小程序-->
				<item type="3" /><!-- 字节跳动小程序-->
				<item type="4" /><!-- PC网站-->
				<item type="5" /><!-- APP应用-->
				<item type="6" /><!-- 支付宝小程序-->
				<item type="7" /><!-- 百度小程序-->
		</supports>

	</platform>


	<bindings>

		<cover><!-- 前端入口地址,不带域名-->
			<entry title="首页" url="/demo/index/index"/>
			<entry title="用户页" url="/demo/user/index"/>
			<entry title="订单页" url="/demo/order/index"/>
		</cover>

		<menu><!-- 管理后台菜单地址,不带域名-->
			<entry title="后台菜单1" url="/demo/admin/index" />
			<entry title="后台菜单2" url="/demo/admin/user" />
			<entry title="后台菜单3" url="/demo/admin/msg" />
			<entry title="后台菜单4" url="/demo/admin/test" />
			<entry title="后台菜单5" url="/demo/admin/sun" />
		</menu>

	</bindings>


    <install>db_install.php</install><!-- 数据库安装文件-->
	<uninstall>db_uninstall.php</uninstall><!-- 数据库卸载文件-->
	<upgrade>db_upgrade.php</upgrade><!-- 数据库升级文件-->

</manifest>

# Name the database

  1. The prefix ofdatabase is sun_. Do not change it
  2. When creating the module data table, add and prefix sun_. For example, the user table of the demo module can be named sun_demo_user
  3. The prefix of the system database issun_core_. Do not deleteand avoid naming the module table with sun_core_ as the prefix

# /app/ directory

/ app/directory to create modules, fully support thinkphp6 application more (opens new window) development mode, development documents can be directly!

# /addons/ directory

/ addons/directory to create a module that does not support the thinkphp6 application more (opens new window) development mode, but as a compatibility function, support run micro holding 2.0 modules.

# Difference between the two

  1. The new application development it is recommended to use thinkphp6 application more (opens new window) development mode
  2. The modules in the /addons/ directory are only run as compatible. This development mode is not recommended for new applications!