]> git.seodisparate.com - c_simple_http/commitdiff
More notes about FOREACH in Changelog.md
authorStephen Seo <seo.disparate@gmail.com>
Wed, 20 Nov 2024 07:21:28 +0000 (16:21 +0900)
committerStephen Seo <seo.disparate@gmail.com>
Wed, 20 Nov 2024 07:21:28 +0000 (16:21 +0900)
Changelog.md

index f610259d9e45da56790ea6d5fe3944efb153ab0e..66d8cdfa74da9d5327de0630f8dd27cf25dfbaa6 100644 (file)
@@ -22,6 +22,21 @@ FOREACH is used like:
     ArrayVar=SecondValue
     ArrayVar=ThirdValue
 
+For multiple variables to expand in FOREACH:
+
+    HTML='''
+        {{{!FOREACH ArrayVar!ArrayVarSecond!ArrayVarThird}}}
+            {{{ArrayVar}}}
+            {{{ArrayVarSecond}}}
+            {{{ArrayVarThird}}}
+        {{{!ENDFOREACH}}}'''
+    ArrayVar=FirstVarOnce
+    ArrayVar=FirstVarTwice
+    ArrayVarSecond=SecondVarOnce
+    ArrayVarSecond=SecondVarTwice
+    ArrayVarThird=ThirdVarOnce
+    ArrayVarThird=ThirdVarTwice
+
 Implemented nestable "IF" and "FOREACH" expressions in templates. In other
 words, there can be `{{{!IF}}}` inside other IF/FOREACH blocks, and vice versa.