![]() |
[Solved] Database Driven Config Question - 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: [Solved] Database Driven Config Question (/showthread.php?tid=68729) |
[Solved] Database Driven Config Question - wolfgang1983 - 08-17-2017 I am working on a config file that I get my contents from database and set them in my config application/config/setting.php As you can see below I can require the database file fine, Is there any way to be able to require codeigniter URI segments Because currently I have to get segments like this so would be better if I could use the url in my config file any ideas how to load url helper in my config file below cheers. PHP Code: $segments = explode('/', trim(parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH), '/')); PHP Code: <?php RE: Database Driven Config Question - salain - 08-17-2017 Hi, You could use a post_controller_constructor hook Where you have access to CI super object. Hook.php PHP Code: $hook['post_controller_constructor'] = array( hook_config.php PHP Code: function config_hook() Don't forget to enable hooks in config.php RE: Database Driven Config Question - wolfgang1983 - 08-19-2017 Thanks for the help all. I load my hooks now like PHP Code: $hook['pre_controller'][] = array( And my language hook PHP Code: <?php And my setting hook PHP Code: <?php |