Hello.

I want to make it so that in the admin part of the project the modules connected to the project are displayed. They could be turned on and off by clicking on the button.

Here we add the module to the project in the module folder. We update the page, this module appeared in our list of connected modules. Then we can turn it off or turn it back on.

How will it be better done and implemented?

Basic application template, adminLTE connected.

  • one
    You can parse composer.json and issue modules that are spelled out in it, as an option - Al Mr
  • @Almr hmm A good option. - Anatoliy.CHA
  • @AlMr but though. If we use it through composer.json, then we can only track author modules that are laid out on any resource. And if we wrote the module itself, then it will not work. I understood correctly? - Anatoliy.CHA
  • Right. composer.json contains only downloaded modules. Which are located in the vendor folder. If you have your own local modules, they should be monitored separately and in some other way. - Al Mr

1 answer 1

Solved the problem by finding an answer to the githaba.

Decision

The point is to create an event that will automatically add project modules to the array and display them in a list.

To do this, in each module you will need to add a configuration and a separate class so that you can transfer data about the module to an array.

An example implementation is given in the link.

The only problem with which there is a problem is the location of the config.php files and class Events, they should not be located in the root folder for all modules, but in the root folder of the module itself.

I hope the information I have found will help someone. )

  • one
    @defaultlocale Thanks for the comment. I'll fix it now. - Anatoliy.CHA
  • It became better, thanks! - default locale