Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.
Dedicated server web hosting provided by Guru-host.eu.
Accessing associative array config values by index

 
Post new topic   Reply to topic    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
cnobes
Smarty n00b


Joined: 26 Jul 2012
Posts: 2

PostPosted: Thu Jul 26, 2012 6:34 pm    Post subject: Accessing associative array config values by index Reply with quote

As I understand the documentation and as of Smarty 2, this worked

Code:
$smarty.config.associate_status[$slot.adminAssociateStatus]


But upon upgrading to Smarty 3 all the above displays is Array.

The above code in the compiled template looks like this.

Code:
<?php echo $_smarty_tpl->getConfigVariable('associate_status');?>


Obviously ignoring the index part.

Ive tried numerous different ways to represent this including using all periods as separators but it keeps continuing to come back the same way. I verified the index has the correct integer in it, but its failing to be passed to the array.
Back to top
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 4199
Location: Hamburg / Germany

PostPosted: Thu Jul 26, 2012 8:15 pm    Post subject: Reply with quote

This is a bug. I will fix it ASAP.
Back to top
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 4199
Location: Hamburg / Germany

PostPosted: Sat Jul 28, 2012 8:11 am    Post subject: Reply with quote

This bug is now fixed in the SVN trunk and will later be included in 3.1.12
Back to top
View user's profile Send private message
cnobes
Smarty n00b


Joined: 26 Jul 2012
Posts: 2

PostPosted: Mon Aug 13, 2012 3:28 am    Post subject: Reply with quote

Thanks for the quick fix. trying to upgrade to v3 and this was a show stopper for us.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> General 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