[eluser]jwindhorst[/eluser]
I'm creating an application for which I would like to be able to pull some user defined configuration settings from the DB to be accessed globally. I was going to add them to the config file but it would appear I don't have the DB at that point.
Thanks!
[eluser]jwindhorst[/eluser]
Maybe I'm asking the wrong question. I want users to be able to customize settings like LOGO_IMAGE_PATH, and then save that path in the DB. I want to be able to access this path always, globally, without hitting the DB in every controller/view, and I don't want it to be a constant that would require the user to edit a file.
Hope that is more clear.
[eluser]Colin Williams[/eluser]
I would get over the idea of hitting the DB on every page load. If it really does concern you, you can use CI's built-in query caching.
[eluser]Colin Williams[/eluser]
Well, if you want to hit a CI page, take what you have in style.php and put it in a Controller file, and point your URI to that Controller.
[eluser]jwindhorst[/eluser]
True, but then it's not global to the application. Currently the css file is in /assets/css/template_name/ directory. Would moving it to /system/application/views/template_name/css/ get my CI core back?
[eluser]jwindhorst[/eluser]
Right, but then it is all echo'd out in the controller right? Making for ugly inline styles in the source which I was trying to avoid. I'm not sure if it can be done any other way, but I would much prefer a more elegant solution.