I am using HTML::Template::Pro in my perl application. I am displaying HTML elements in a loop and I want to show something after the second element of the loop. I added the loop_context_vars
in my HTML::Template::Pro initialization, getting access to variables inside the loop (like __counter__
).
Now I am looking for a way to check for a specific iteration of this loop to insert my HTML element.
<TMPL_IF __counter__ == 2>
My new HTML element.
</TMPL_IF>
How can I access the __counter__
variable inside conditional statements in HTML::Template::Pro?
In HTML::Template::Pro, you can use expressions like in HTML::Template::Expr