# 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.phpand package.jsonare required, others are optional.

# meaning and function

# assetsdirectory

This directory stores some static resource files such as CSS, JavaScriptand images. The structure in the assetsdirectory is optional.

# langdirectory

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 enand zh_CN under the ``langdirectory. (representing English and Simplified Chinese respectively)

# srcdirectory

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.

# viewsdirectory

This contains the plugin's view files.

# bootstrap.phpfile

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.phpfile

This file handles the code to be executed when the plugin is enabled, disabled, and uninstalled.

# package.jsonfile

This file records some basic information of the plugin.