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

$smarty. is an unknown reference within {section}

 
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
moapoa
Smarty Rookie


Joined: 29 Jun 2006
Posts: 20

PostPosted: Sat Aug 05, 2006 3:07 am    Post subject: $smarty. is an unknown reference within {section} Reply with quote

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
View user's profile Send private message
iriePub
Smarty Regular


Joined: 16 Jun 2006
Posts: 53

PostPosted: Sat Aug 05, 2006 9:01 am    Post subject: Reply with quote

I think you just have to use:

{myplugin num=$smarty.section.n.index}

in the plugin Wink

it's like this in an if clause. instead of using

{if {$var} == 'val'}

you have to use

{if $var == 'val'}

Wink
Back to top
View user's profile Send private message
moapoa
Smarty Rookie


Joined: 29 Jun 2006
Posts: 20

PostPosted: Sun Aug 06, 2006 6:08 am    Post subject: Reply with quote

Ah, you're right! thanks.

weird error message.
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