|
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 |
gaar Smarty n00b
Joined: 20 Feb 2010 Posts: 1
|
Posted: Sat Feb 20, 2010 5:05 pm Post subject: Error in documentation regarding config_load |
|
|
About '{config_load}' the documentation says:
default value 'scope' - local.
But the test code shows that the default value 'scope' - global.
For check use this code (used Smarty v.2.6.26):
test.conf
Code: | [General]
TestString = "General Section"
[Test]
TestString = "Test Section"
|
test.tpl
Code: | {config_load file='test.conf' section='General'}
<p>{#TestString#}</p>
{include file='test_inc.tpl'}
<p>{#TestString#}</p> |
test_inc.tpl
Code: | {config_load file='test.conf' section='Test'} |
After runing $smarty->display('test.tpl') get the output:
Quote: | General Section
Test Section |
Also scope displayed in the debugging console:
Quote: | test.tpl (0.02186) (total)
test.conf [General] global (0.00232)
test_inc.tpl (0.00426)
test.conf [Test] global (0.00169)
|
If add set scope in test_inc.tpl
Code: | {config_load file='test.conf' section='Test' [b]scope='local'[/b]} |
After runing $smarty->display('test.tpl') get the output:
Quote: | General Section
General Section |
In the debugging console:
Quote: | test.tpl (0.06447) (total)
test.conf [General] global (0.00229)
test_inc.tpl (0.05487)
test.conf [Test] local (0.00227)
|
|
|
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
|