|
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 |
Mike Bradley Smarty n00b
Joined: 18 Apr 2003 Posts: 4
|
Posted: Fri Apr 18, 2003 1:13 am Post subject: Unnecessary overhead for config_file? |
|
|
I have been using config_file to implement language versions of my pages (the language files being selected at install time, rather than run-time), but looking at the compiled code I was wondering if these were being implemented in the best way.
It strikes me that .conf files are not intended to be changed that often, in which case could the configuration values not be inserted statically into the compiled page? Any changes to the .conf files would need to result in a recompile.
This would save the script from having to load and parse the .conf files on each page load, at least when the file is loaded with local scope.
Any downside on this? Am I correct in thinking that {# #} values are supposed to be more static than {$ } values?
Mike
Last edited by Mike Bradley on Fri Apr 18, 2003 1:16 am; edited 1 time in total |
|
Back to top |
|
Tom Sommer Administrator
Joined: 16 Apr 2003 Posts: 47 Location: Denmark
|
Posted: Fri Apr 18, 2003 1:15 am Post subject: |
|
|
IIRC config files are already pre-compiled? |
|
Back to top |
|
Mike Bradley Smarty n00b
Joined: 18 Apr 2003 Posts: 4
|
Posted: Fri Apr 18, 2003 1:20 am Post subject: |
|
|
Well what do you know - they already thought of that! I never realised that the config files were compiled as well!
Mike |
|
Back to top |
|
Tom Sommer Administrator
Joined: 16 Apr 2003 Posts: 47 Location: Denmark
|
Posted: Fri Apr 18, 2003 1:21 am Post subject: |
|
|
great isn't it |
|
Back to top |
|
Mike Bradley Smarty n00b
Joined: 18 Apr 2003 Posts: 4
|
Posted: Fri Apr 18, 2003 2:14 am Post subject: |
|
|
One thing - how do I assign the values 'Yes' and 'No' in the config file?
If I do:
lsYes = Yes
lsNo = No
They get evaluated to 1 and 0 respectively
But if I do
lsYes = Ja
lsNo = Nej
They evaluate to Ja and Nej - do Yes and No have special meaning here? If I enclose in quotes, it has no effect.
Mike |
|
Back to top |
|
plockaby Guest
|
|
Back to top |
|
Mike Bradley Smarty n00b
Joined: 18 Apr 2003 Posts: 4
|
Posted: Fri Apr 18, 2003 10:53 am Post subject: |
|
|
You star - it took a few goes and I had to remember to delete my cache, but it worked just fine.
Mike |
|
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
|