Hi, I have the following smarty code:
{foreach from=$additional_fields item=v}
{if $v.fieldid eq 5}
{php}
// several pounds of php code here
$myfieldid = {$v.fieldid}; // this is wrong
{/php}
{/if}
{/foreach}
I'm trying to grab the current field id with my custom php code, in other words {$v.fieldid}. I've found a few posts referencing $this->_tpl_vars[somevar] to get smarty variables when inside the {php} tags, but that doesn't seem to work with foreach.
I realize that using the {php} tags in smarty is counter-intuitive to the whole smarty concept and like totally lame, but I have my reasons. Thanks for the help!