diff --git a/QUICKSTART b/QUICKSTART index a91e91d8..807352eb 100644 --- a/QUICKSTART +++ b/QUICKSTART @@ -63,7 +63,7 @@ $smarty->display("./templates/index.tpl");
- There were {%people.loop%} names in this list.
+ {section name=people loop=$FirstName}
+ {%people.rownum%} {$people/FirstName} {$people/LastName}
+ {sectionelse}
+ There are no values to loop through.
+ {/section}
+
+ There were {%people.loop%} names in this list.
{include file="footer.tpl"}
@@ -246,35 +266,35 @@ $smarty = new Smarty;
$smarty->assign("FirstName",array("Ned","Bart","Montgomery"));
$smarty->assign("LastName",array("Flanders","Simpson","Burns"));
$smarty->assign("ContactNames",array(
- array("email","home","cell"),
- array("email","home"),
- array("email","home","fax")
- ));
+ array("email","home","cell"),
+ array("email","home"),
+ array("email","home","fax")
+ ));
$smarty->assign("ContactVals",array(
- array("fred@simpsons.com","555-666-7777","555-444-3333"),
- array("bart@simpsons.com","555-111-2222"),
- array("monty@simpsons.com","555-888-9999","555-234-5678"),
- ));
+ array("fred@simpsons.com","555-666-7777","555-444-3333"),
+ array("bart@simpsons.com","555-111-2222"),
+ array("monty@simpsons.com","555-888-9999","555-234-5678"),
+ ));
$smarty->display("./templates/index.tpl");
?>
--------- templates/index.tpl --------
{include file="header.tpl" title="Home Page"}
- {section name=people loop=$FirstName}
- {%people.rownum%} {$people/FirstName} {$people/LastName}
- {section name=contacts loop=$people/ContactNames}
- {* for fun, lets bold every other row *}
- {if %contacts.rownum% is even}{/if}
- {$people/contacts/ContactNames}: {$people/contacts/ContactVals}
- {if %contacts.rownum% is even}{/if}
- {/section}
-
- {sectionelse}
- There are no values to loop through.
- {/section}
-
- There were {%people.loop%} names in this list.
+ {section name=people loop=$FirstName}
+ {%people.rownum%} {$people/FirstName} {$people/LastName}
+ {section name=contacts loop=$people/ContactNames}
+ {* for fun, lets bold every other row *}
+ {if %contacts.rownum% is even}{/if}
+ {$people/contacts/ContactNames}: {$people/contacts/ContactVals}
+ {if %contacts.rownum% is even}{/if}
+ {/section}
+
+ {sectionelse}
+ There are no values to loop through.
+ {/section}
+
+ There were {%people.loop%} names in this list.
{include file="footer.tpl"}
diff --git a/Smarty.addons.php b/Smarty.addons.php
index 216d3d94..fe5c278b 100644
--- a/Smarty.addons.php
+++ b/Smarty.addons.php
@@ -4,7 +4,8 @@
* Project: Smarty: the PHP compiled template engine
* File: Smarty.addons.php
* Author: Monte Ohrt
testing strip tags
{strip}
testing strip tags
{strip}
+{* bold and title are read from the config file *}
+{if #bold#}{/if}
Title: {#title#|capitalize}
+{if #bold#}{/if}
the value of $SCRIPT_NAME is {$SCRIPT_NAME}
-{* A simple variable test *}
+{* A simple variable test. print $Name in uppercase *}
hello, my name is {$Name|upper}
My interests are:
@@ -22,16 +25,14 @@ My interests are:
none
{/section}
-({$FirstName|@count})
-
-{insert name=paginate}
+
-
+
This is a test
diff --git a/doc.sgm b/doc.sgm
index bb225c1d..9a56f9f1 100644
--- a/doc.sgm
+++ b/doc.sgm
@@ -1762,4 +1762,13 @@ is the first week that has at least 4 days in the current year, and with Monday
modifiers.
+
+{* bold and title are read from the config file *}
+{if #bold#}{/if}
Title: {#title#|capitalize}
+{if #bold#}{/if}
the value of $SCRIPT_NAME is {$SCRIPT_NAME}
-{* A simple variable test *}
+{* A simple variable test. print $Name in uppercase *}
hello, my name is {$Name|upper}
My interests are:
@@ -22,16 +25,14 @@ My interests are:
none
{/section}
-({$FirstName|@count})
-
-{insert name=paginate}
+
-
+
This is a test