|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Thu Jul 30, 2015 9:51 am Post subject: Is there a way to read configuration from different source? |
|
|
I'm not exactly clear after reading the documentation.
Can I set a handler to read config vars from database table, f.e.? |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Thu Jul 30, 2015 2:07 pm Post subject: |
|
|
Config files are text which is parsed and compiled like a template source. It can be loaded from other resources same way like templates.
It might be possible to create a custom resource which for example reads a mysql table where each row is assigned to a config variable.
The major challenge would be how a cached template could detect modifications of template var and rebuild the cache. |
|
Back to top |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Thu Jul 30, 2015 10:49 pm Post subject: |
|
|
Cached template shouldn't detect anything The point of caching.
Anyway, thanks for assurance. My idea is to write response handler with Smarty as its body content producer, and use Smarty config functionality to set up site variables.
I'll be fine with files for a while, but eventually I'd like to move to more accessible storage. |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|