« Back to Product

Documentation

Structure

Description

The required structure is necessary for correct functioning within IP-Symcon. Integration via Module Control only works if the structure is adhered to.

  • The "library.json" is the core of every module development.
  • The "module.php" and "module.json" together form the actual module.
  • Form.json can be used to set up the configuration page.
  • Locale.json is used for possible translations.
  • The module folder name (here: Module1, Module2) should have the same name as the class name in module.php.

Folders that do not contain any module.json are marked as faulty.
Exceptions are the folders:

  • libs/ (since version 4.2)
  • docs/ (since version 4.2)
  • imgs/ (since version 4.2)
  • tests/ (since version 4.4)
  • actions/ (since version 6.0)
Warning

Point-folders (e.g. .github, .style) are also ignored and are not necessary for the module to function correctly. These are important, for example, for the correct functioning of the repository.

These folders are not integrated as a module and offer the possibility of making external libraries, documents, images and tests available.

Directory structure

Library
|
- Module1
|                          |   |
| - module.php             |
|                          |   |
| - module.json            |
|                          |   |
| - form.json (optional)   |
|                          |   |
| - locale.json (optional) |
|                          |
- Module2
|                          |   |
| - module.php             |
|                          |   |
| - module.json            |
|                          |   |
| - form.json (optional)   |
|                          |   |
| - locale.json (optional) |
|                          |
- actions (optional)
|                          |   |
| - Definitions of actions |
|                          |
- libs (optional)
|                 |   |
| - any libraries |
|                 |
- docs (optional)
|                 |   |
| - any documents |
|                 |
- imgs (optional)
|                   |   |
| - any media files |
|                   |
- tests (optional)
|                  |   |
| - any test files |
|                  |
- library.json
|
- README.txt (optional)

Validation

JSON schemas are available for the JSON files of a module. With them, editors like Visual Studio Code or PhpStorm can offer autocompletion and check the files while editing. To do this, the schema is specified in the respective file via the parameter "$schema", e.g. "$schema": "https://www.symcon.de/assets/files/validation/librarySchema.json". IP-Symcon ignores this parameter.

File JSON schema
library.json librarySchema.json
module.json moduleSchema.json
form.json formSchema.json (see Configuration forms)
locale.json localeSchema.json
Any questions?