Skip to content
Marcus edited this page Oct 14, 2015 · 3 revisions

The each directive can be used to iterate over an enumerable collection after which each object of the collection becomes the current scope. It's syntax is


Syntax

$$#each <exprA>$$
   ...
   $$ <exprB> $$
   ...
$$#else$$
   ...
$$/each$$
  • May be empty: no
  • May be nested: yes

The $$#else$$ block is optional. The $$#else$$ clause is only executed if the enumerable is empty. Note that #each introduces a new scope, namely the current object of the enumerator. This means that <exprA> is evaluated in a different context/scope than <exprB>, the latter is evaluated against the Current enumerable item.

Clone this wiki locally