Closed elvispdosreis closed 1 year ago
Have you tried passing it as a variable? This might work:
{foreach $produtos as $produto}
{include file="item.tpl" iteration=$produto@iteration}
{/foreach}
And change item.tpl so it used $iteration
instead of $produto@iteration
.
in version 3.1 I didn't have this behavior, more in the way you suggested also works
smarty/smarty: 3.1 php 7.4
Actually, I have the same error "Undefined property: Smarty_Variable::$iteration" with Smarty 3.1.46. Which version are you using?
Closed because of inactivity.
I have a problem with an iteration variable, I need to somehow use it in the main template, if I try to use it in the include template without having used it in the main one, I get the error "Undefined property: Smarty_Variable::$iteration"
does not work
it works
item.tpl
PHP: 8.1 Smarty: 4.3.1