From 4fffc098952fd4a826252e0a8275668ab4db1329 Mon Sep 17 00:00:00 2001 From: messju Date: Thu, 26 May 2005 13:47:49 +0000 Subject: [PATCH] fixed whitespaces by Peter --- .../language-function-section.xml | 206 +++++++++--------- 1 file changed, 103 insertions(+), 103 deletions(-) diff --git a/docs/en/designers/language-builtin-functions/language-function-section.xml b/docs/en/designers/language-builtin-functions/language-function-section.xml index 9882d3e7..b34ed05f 100644 --- a/docs/en/designers/language-builtin-functions/language-function-section.xml +++ b/docs/en/designers/language-builtin-functions/language-function-section.xml @@ -105,10 +105,10 @@ $smarty->assign('custid',$data); - {/section} +{* this example will print out all the values of the $custid array *} +{section name=customer loop=$custid} + id: {$custid[customer]}
+{/section}
{* print out all the values of the $custid array reversed *} {section name=foo loop=$custid step=-1} @@ -121,9 +121,9 @@ $smarty->assign('custid',$data); - id: 1001
- id: 1002
+id: 1000
+id: 1001
+id: 1002

id: 1002
id: 1001
@@ -183,13 +183,13 @@ $smarty->assign('address',$addr); This example assumes that $custid, $name and $address are all arrays containing the same number of values *} - {section name=customer loop=$custid} +{section name=customer loop=$custid}

- id: {$custid[customer]}
- name: {$name[customer]}
+ id: {$custid[customer]}
+ name: {$name[customer]}
address: {$address[customer]}

- {/section} +{/section} ]]>
@@ -198,18 +198,18 @@ $smarty->assign('address',$addr); - id: 1000
- name: John Smith
+ id: 1000
+ name: John Smith
address: 253 N 45th

-

- id: 1001
- name: Jack Jones
+

+ id: 1001
+ name: Jack Jones
address: 417 Mulberry ln

-

- id: 1002
- name: Jane Munson
+

+ id: 1002
+ name: Jane Munson
address: 5605 apple st

]]> @@ -225,12 +225,12 @@ $smarty->assign('address',$addr); as it is used to reference the data within the section *} {section name=anything loop=$custid} -

+

id: {$custid[anything]}
name: {$name[anything]}
address: {$address[anything]}

- {/section} +{/section} ]]> @@ -275,15 +275,15 @@ $smarty->assign('contact_info', $info); arrays. In this example, $contact_type[customer] is an array of contact types for the current customer. *} - {section name=customer loop=$custid} +{section name=customer loop=$custid}
- id: {$custid[customer]}
- name: {$name[customer]}
- address: {$address[customer]}
- {section name=contact loop=$contact_type[customer]} - {$contact_type[customer][contact]}: {$contact_info[customer][contact]}
- {/section} - {/section} + id: {$custid[customer]}
+ name: {$name[customer]}
+ address: {$address[customer]}
+ {section name=contact loop=$contact_type[customer]} + {$contact_type[customer][contact]}: {$contact_info[customer][contact]}
+ {/section} +{/section} ]]> @@ -292,28 +292,28 @@ $smarty->assign('contact_info', $info); - id: 1000
- name: John Smith
- address: 253 N 45th
- home phone: 555-555-5555
+ id: 1000
+ name: John Smith
+ address: 253 N 45th
+ home phone: 555-555-5555
cell phone: 666-555-5555
- e-mail: john@myexample.com
+ e-mail: john@myexample.com

- id: 1001
- name: Jack Jones
- address: 417 Mulberry ln
+ id: 1001
+ name: Jack Jones
+ address: 417 Mulberry ln
home phone: 123-456-4
web: www.example.com

- id: 1002
- name: Jane Munson
- address: 5605 apple st
+ id: 1002
+ name: Jane Munson
+ address: 5605 apple st
cell phone: 0457878
]]>
- + sections and associative arrays @@ -340,14 +340,14 @@ $smarty->assign('contacts',$data); This is an example of printing an associative array of data within a section *} - {section name=customer loop=$contacts} +{section name=customer loop=$contacts}

- name: {$contacts[customer].name}
- home: {$contacts[customer].home}
- cell: {$contacts[customer].cell}
+ name: {$contacts[customer].name}
+ home: {$contacts[customer].home}
+ cell: {$contacts[customer].cell}
e-mail: {$contacts[customer].email}

- {/section} +{/section} ]]>
@@ -356,19 +356,19 @@ $smarty->assign('contacts',$data); - name: John Smith
- home: 555-555-5555
+ name: John Smith
+ home: 555-555-5555
cell: 666-555-5555
e-mail: john@myexample.com

- name: Jack Jones
+ name: Jack Jones
home phone: 777-555-5555
cell phone: 888-555-5555
e-mail: jack@myexample.com

- name: Jane Munson
+ name: Jane Munson
home phone: 000-555-5555
cell phone: 123456
e-mail: jane@myexample.com @@ -397,7 +397,7 @@ $smarty->assign('contacts',$db->getAll($sql) );  Name>HomeCellEmail {section name=co loop=$contacts} - view + view {$contacts[co].name} {$contacts[co].home} {$contacts[co].cell} @@ -413,12 +413,12 @@ $smarty->assign('contacts',$db->getAll($sql) ); {sectionelse} - {sectionelse} - there are no values in $custid. - {/section} +{* sectionelse will execute if there are no $custid values *} +{section name=customer loop=$custid} + id: {$custid[customer]}
+{sectionelse} + there are no values in $custid. +{/section} ]]>
@@ -446,7 +446,7 @@ $smarty->assign('contacts',$db->getAll($sql) ); Technical Note If the step and start section properties are not - modified, then this works the same as the iteration section property, except it starts at 0 instead of 1. @@ -457,9 +457,9 @@ $smarty->assign('contacts',$db->getAll($sql) ); - {/section} +{section name=customer loop=$custid} + {$smarty.section.customer.index} id: {$custid[customer]}
+{/section} ]]> @@ -467,9 +467,9 @@ $smarty->assign('contacts',$db->getAll($sql) ); - 1 id: 1001
- 2 id: 1002
+0 id: 1000
+1 id: 1001
+2 id: 1002
]]>
@@ -511,8 +511,8 @@ $smarty->assign('custid',$data); - - + + {section name=cus loop=$custid} @@ -520,7 +520,7 @@ $smarty->assign('custid',$data); - {/section} +{/section}
indexidindex_prevprev idindex_nextnext idindex_prevprev_idindex_nextnext_id
{$smarty.section.cus.index_prev}{$custid[cus.index_prev]} {$smarty.section.cus.index_next}{$custid[cus.index_next]}
]]> @@ -529,11 +529,11 @@ $smarty->assign('custid',$data); @@ -574,7 +574,7 @@ $smarty->assign('custid',$id); iteration={$smarty.section.cu.iteration} index={$smarty.section.cu.index} id={$custid[cu]}
- {/section} +{/section} ]]> @@ -602,7 +602,7 @@ iteration=6 index=15 id=3015
{section name=co loop=$contacts} {if $smarty.section.co.iteration % 5 == 1}  Name>HomeCellEmail - {/if} + {/if}
view {$contacts[co].name} @@ -610,7 +610,7 @@ iteration=6 index=15 id=3015
{$contacts[co].cell} {$contacts[co].email} - {/section} +{/section} ]]> @@ -646,21 +646,21 @@ iteration=6 index=15 id=3015
idcustomer - {/if} + {/if} {$customers[customer].id}} {$customers[customer].name} - {if $smarty.section.customer.last} + {if $smarty.section.customer.last} {$smarty.section.customer.total} customers - {/if} - {/section} + {/if} +{/section} ]]> @@ -686,9 +686,9 @@ iteration=6 index=15 id=3015
{section} property index - {/section} +{section name=customer loop=$custid} + {$smarty.section.customer.index} id: {$custid[customer]}
+{/section} There were {$smarty.section.customer.loop} customers shown above. ]]> @@ -698,9 +698,9 @@ iteration=6 index=15 id=3015
- 1 id: 1001
- 2 id: 1002
+0 id: 1000
+1 id: 1001
+2 id: 1002
There were 3 customers shown above. ]]> @@ -723,15 +723,15 @@ iteration=6 index=15 id=3015
$show_customer_info (true/false) may have been passed from the PHP application, to regulate whether or not this section shows *} - {section name=customer loop=$custid show=$show_customer_info} - {$smarty.section.customer.rownum} id: {$custid[customer]}
- {/section} +{section name=customer loop=$custid show=$show_customer_info} + {$smarty.section.customer.rownum} id: {$custid[customer]}
+{/section} - {if $smarty.section.customer.show} - the section was shown. - {else} - the section was not shown. - {/if} +{if $smarty.section.customer.show} + the section was shown. +{else} + the section was not shown. +{/if} ]]>
@@ -739,11 +739,11 @@ iteration=6 index=15 id=3015
- 2 id: 1001
- 3 id: 1002
+1 id: 1000
+2 id: 1001
+3 id: 1002
- the section was shown. +the section was shown. ]]>
@@ -758,9 +758,9 @@ iteration=6 index=15 id=3015
{section} property total - {/section} +{section name=customer loop=$custid step=2} + {$smarty.section.customer.index} id: {$custid[customer]}
+{/section} There were {$smarty.section.customer.total} customers shown above. ]]> @@ -770,11 +770,11 @@ iteration=6 index=15 id=3015
+0 id: 1000
2 id: 1002
4 id: 1004
- There were 3 customers shown above. +There were 3 customers shown above. ]]>