diff --git a/QUICKSTART b/QUICKSTART
index 9544dd8f..511bd4d0 100644
--- a/QUICKSTART
+++ b/QUICKSTART
@@ -259,6 +259,33 @@ the section that display the loop iteration and the total number of times the
section is looped. Also note the {sectionelse}. This would have been displayed
had the loop array $FirstName been empty.
+You can access keys of arrays with this syntax:
+
+--------- index.php --------
+assign(array("ContactInfo" => array(
+ array("FirstName" => "Ned","LastName" => "Flanders"),
+ array("FirstName" => "Monty","LastName" => "Burns")
+ )
+ ));
+$smarty->display("index.tpl");
+?>
+
+--------- templates/index.tpl --------
+{include file="header.tpl" title="Home Page"}
+ {section name=people loop=$ContactInfo}
+ {$ContactInfo[people].FirstName}
+ {$ContactInfo[people].LastName}
+ {sectionelse}
+ There are no values to loop through.
+ {/section}
+
+ There were {%people.loop%} names in this list. +{include file="footer.tpl"} + + You can also do complex nested sections, like so: --------- index.php -------- diff --git a/demo/index.php b/demo/index.php index d3246dde..5acebb36 100644 --- a/demo/index.php +++ b/demo/index.php @@ -1,7 +1,5 @@ clear_all_cache();