简体   繁体   中英

Zend Framework 2 Module config from database

i am currently working on a project with zend 2 framework and i am trying to find out if its possible to controll whether a module is activ or not by the database.

I am trying to create an admin panel for my project and there i want to active and deactivate modules.

One thought was to load the config from the database in the "index.php" file before this line of code :

// Run the application!
Zend\Mvc\Application::init(require 'config/basic.config.php')->run();

So instead of using the config from basic.config.php i will load the data from the database and create an array just like the one in the basic.config.php file.

Would this be the right way to achieve this ?

Is it also possible to load a module config from database ? So i can change the route for a module from the admin panel.

Cheers !

My suggestion is to write information from admin panel in configuration files by Writer . If you use PhpArray then read configuration without parsing and reading from files is faster than the database.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM