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

trying to index arrays with smarty variable

 
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 -> General
View previous topic :: View next topic  
Author Message
setcookie
Smarty Rookie


Joined: 29 Aug 2006
Posts: 6

PostPosted: Tue Sep 12, 2006 7:07 am    Post subject: trying to index arrays with smarty variable Reply with quote

i found this in the manual {$foo.$bar} or even {$foo[4].$baz}

unfortunatly this doesnt work? in my case

$GLOBAL.SUBNAVI.$GLOBAL.PG

Warning: Illegal offset type in ...

can someone please explain why this simply array indexing via variable is not working? something so elementary?

fra*
Back to top
View user's profile Send private message
Hielke Hoeve
Smarty Elite


Joined: 06 Jan 2006
Posts: 406
Location: Netherlands

PostPosted: Tue Sep 12, 2006 9:17 am    Post subject: Reply with quote

Because you are trying to access another sub value after the $GLOBAL? Try this:

$GLOBAL.SUBNAVI[$GLOBAL].PG
or
$GLOBAL.SUBNAVI.[$GLOBAL.PG]

whichever you meant.

In my problem

$_SESSION.user.pageaccess.lots.*
or
$_SESSION.user.pageaccess.lots[*]

doesnt work, while I do need to check this entry Crying or Very sad
_________________
Debug XHTML Compliance
SmartyPaginate
Smarty License Questions
---
(About Unix) The learning curve is full of aha! moments, such as that glorious day that the full beauty of grep and, later, find is revealed in all its majesty. --- Robert Uhl <ruhl@4dv.net>
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 -> 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