|
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 |
blue Smarty Rookie
Joined: 07 Aug 2003 Posts: 7
|
Posted: Fri Oct 31, 2003 1:43 pm Post subject: array object |
|
|
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 (
modulename => article
read => 1
write => 1
delete => 1
delete_others =>
modify => 1
modify_others =>
module_level => empty |
|
Back to top |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Fri Oct 31, 2003 10:26 pm Post subject: |
|
|
hi blue. I'm fairly certain that syntax is not allowed. I know I never tried it [messju knows better, though ]
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 |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Fri Oct 31, 2003 11:25 pm Post subject: |
|
|
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 |
|
|
|
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
|