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

array object

 
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 -> Tips and Tricks
View previous topic :: View next topic  
Author Message
blue
Smarty Rookie


Joined: 07 Aug 2003
Posts: 7

PostPosted: Fri Oct 31, 2003 1:43 pm    Post subject: array object Reply with quote

hello i'm using smarty 2.6 rc2 and i've got a problem

i've got an array with object in it, but how can i acces de variable modulename??

i've tried the following

{$userRights.article->moduleName}

but i just see a blank page....


{$userRights} Array (7)
article => rights Object (Cool
modulename => article
read => 1
write => 1
delete => 1
delete_others =>
modify => 1
modify_others =>
module_level => empty
Back to top
View user's profile Send private message
boots
Administrator


Joined: 16 Apr 2003
Posts: 5611
Location: Toronto, Canada

PostPosted: Fri Oct 31, 2003 10:26 pm    Post subject: Reply with quote

hi blue. I'm fairly certain that syntax is not allowed. I know I never tried it Smile [messju knows better, though Wink]

On the other hand, assigning to a temporary template variable should do the trick:

{assign var=article value=userRights.article}
{$article->moduleName}

HTH


Last edited by boots on Fri Oct 31, 2003 11:54 pm; edited 1 time in total
Back to top
View user's profile Send private message
messju
Administrator


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Fri Oct 31, 2003 11:25 pm    Post subject: Reply with quote

hi blue. I'm fairly certain that syntax *is* allowed and produces correct php-code with 2.6.2-RC2. maybe your data is not assigned correctly.
does {$userRights|debug_print_var} give the expected structure as a result?
Back to top
View user's profile Send private message Send e-mail Visit poster's website
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 -> Tips and Tricks 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