For example, in this code:
<div id="user_collection_requests-${id} table-cell" class="user_collection_requests">
{{if requests}}
{{each(i, user) requests}}
<div id="user_collection_request-${id}-${user.id}" ...
{{/each}}
{{/if}}
</div>
The first ${id}
prints the outer object's id
attribute, but the second ${id}
prints the same as ${user.id}
. I want to grab the outer scope's id
from within the {{each}}
block.
Is this possible? Or do I have to be sure to name the variables so that a collision like this will not occur?
You can declare a variable outside your {{each}} block
${( $data.localVariable = $id ),''}
and access it inside later
${localVariable}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With