Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Error in documentation regarding config_load

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Documentation
View previous topic :: View next topic  
Author Message
gaar
Smarty n00b


Joined: 20 Feb 2010
Posts: 1

PostPosted: Sat Feb 20, 2010 5:05 pm    Post subject: Error in documentation regarding config_load Reply with quote

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
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Documentation All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP