ASISG
Gy - php framework/CMS | Documentation | Modules
Modules
Modules are needed to separate classes, components, admin pages related to the same data structures, that is, they can be separated into logical parts of the gy framework pieces.
The module class has been implemented (methods are commented) that allows you to work with modules, connect the necessary ones, keep track of the currently connected components and bind components with modules.
Modules are located in /gy/modules/< module name >/
. The modules have the following structure (these are sections and files in the module section):
/component/
- the components related to this module are stored here;/classes/
- classes related to this module;/admin/
- admin pages related to this module;/install/installDataBaseTable.php
- file for installing the part of the database associated with this module;/init.php
- module initialization file, it describes what components, classes, admin pages are set in this module and the name of the module.
Features
- When developing new modules, the developer must adhere to the given structure (the veracity of the one specified in init.php is on the conscience of the module developers).
- All available modules are connected when the gy framework is connected (all modules located in the specified directory).
- Working with the components of the module, calling the component and working with the classes of the module is carried out in the same way as if the classes were in the standard folder
/gy/classes/
and the components in/gy/components/
. - You can access the pages of the admin panel module through the file
/gy/admin/get-admin-page.php?page=< page name >
, without specifying a specific module, just the name of the page + if you need the necessary parameters for it. - The names of components, classes, admin pages must be unique between all modules and all project files.
- The installation file, console
/gy/modules/< module name>/install/installDataBaseTable.php
and will be launched while running/gy/install/installDataBaseTable.php
(launched when gy framework is installed), or rather will be produced installation of parts of the database associated with all available modules.
Currently implemented modules:
containerdata
- for working with data containers;filemodule
- for working with site pages.