CodeIgniter Forums
Modules enable / disable from the admin panel and affect on fron side - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: Modules enable / disable from the admin panel and affect on fron side (/showthread.php?tid=65697)



Modules enable / disable from the admin panel and affect on fron side - kartikpatel6390 - 07-13-2016

Hi,

I would like to develope an admin panel from which superadmin can enable / disable module and that will affect on front end as well. Here is the structure of UI

-----------------------------------------------------------------
Module Name     |     Action     |     Last Updated
-----------------------------------------------------------------
Login                 |    Enable      |   21-02-2016
_________________________________________
Slider                 |    Disable      |   21-02-2016
_________________________________________
Contact Us        |    Enable       |   21-02-2016
_________________________________________

Here are my modules
Login
Slider
Contact Us

and also same name as module name as in front end application.
How can I manage all these stuff, What should be the database structure, How can I check if module enable or disable on every page load?


RE: Modules enable / disable from the admin panel and affect on fron side - InsiteFX - 07-13-2016

Table modules

You need to add a database field module_enabled or to the likes, then you can store the information in the database.

you would need to check each module before displaying it to see if it is enabled or not.

The best place to do that would be in a MY_Controller.