# Plugin directory structure
# overview
- [Category] assets
- [catalogue] lang
- [directory] src
- [Category] views
- [file] bootstrap.php
- [file] callbacks.php
- [file] package.json
In the above list, except bootstrap.php
and package.json
are
required, others are optional.
# meaning and function
# assets
directory
This directory stores some static resource files such as CSS
,
JavaScript
and images. The structure in the assets
directory is
optional.
# lang
directory
This directory stores language files. If your plugin is multilingual,
put the language files here. Currently, only Simplified Chinese and
English are supported, so there should only be two directories en
and
zh_CN under the ``lang
directory. (representing English and Simplified
Chinese respectively)
# src
directory
This contains the PHP code for the plugin. The internal directory structure is optional, but note that the namespace in the PHP code must be arranged according to the directory structure you arrange.
# views
directory
This contains the plugin's view files.
# bootstrap.php
file
Do not associate this file with Bootstrap, the Twitter front-end framework! There is no relationship between them.
This file is the entry file of the entire plugin. When the plugin is loaded, this file will be loaded first. This file will be loaded and executed as long as the plugin is not disabled.
# callbacks.php
file
This file handles the code to be executed when the plugin is enabled, disabled, and uninstalled.
# package.json
file
This file records some basic information of the plugin.