as an example:
{section name=x loop=$vExample}
{if $vExample[x.index_prev].examplevar eq '0'}
prev
{/if}
{$vExample[x.index_prev].examplevar }
{/section}
Something like this returns an "unidentified token [x.index_prev].examplevar" error triggered from the "_compile_if" function for the line {if $vExample[x.index_prev].examplevar eq '0'} and if I change "x.index_prev" for "$templatelite.section.x.index_prev", I get a "parse error ... eval()'d code ..." error and the if section in the compiled php version looks like this:
_vars['vExample'][$this->_sections['x']['index']]['examplevar'] != $this->_vars['vExample'] $this->_sections['x']['index_prev']): ?>when it should be:
_vars['vExample'][$this->_sections['x']['index']]['examplevar'] != $this->_vars['vExample'][ $this->_sections['x']['index_prev']]): ?>This bug is for an error in the vars regex. But I've a basic level knowlegde of regex so I can't send a possible fix.
I hope you can fix this, or publish a patch.
There is an alternative for this, assigning the value to a new variable and then use that variable as the key for array, but that means to create more innecesary variables...
Example:
{assign var=idxprev value=$templatelite.section.x.index_prev}
{if $vExample[$idxprev].examplevar eq '0'}
Thanks for place an eye on this ;)
Anonymous
Sorry, I register in SF before send this bug/issue.
Thank you for The feature, bug ticket. I have recently acquired this project and am looking into this. I am thinking about redesigning the compilers regex usage as it is using deprecated php functions. this will also remove the php4 support, and add object (class) usage in the templates.
Ticket moved from /p/templatelite/feature-requests/13/
This has been implemented, and will be included in the v2.20 release in January 2018.