|
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 |
moapoa Smarty Rookie
Joined: 29 Jun 2006 Posts: 20
|
Posted: Sat Aug 05, 2006 3:07 am Post subject: $smarty. is an unknown reference within {section} |
|
|
Code: | {section name=n start=1 loop=$foo.bar}
stuff
{$smarty.section.n.index}
stuff
{/section}
|
is okay, but when you use that variable in a plugin:
Code: | {section name=n start=1 loop=$foo.bar}
stuff
{myplugin num={$smarty.section.n.index}}
stuff
{/section}
|
you get:
$smarty. is an unknown reference
why? |
|
Back to top |
|
iriePub Smarty Regular
Joined: 16 Jun 2006 Posts: 53
|
Posted: Sat Aug 05, 2006 9:01 am Post subject: |
|
|
I think you just have to use:
{myplugin num=$smarty.section.n.index}
in the plugin
it's like this in an if clause. instead of using
{if {$var} == 'val'}
you have to use
{if $var == 'val'}
|
|
Back to top |
|
moapoa Smarty Rookie
Joined: 29 Jun 2006 Posts: 20
|
Posted: Sun Aug 06, 2006 6:08 am Post subject: |
|
|
Ah, you're right! thanks.
weird error message. |
|
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
|