]> git.mxchange.org Git - friendica.git/blob - library/Smarty/demo/templates/index.tpl
add smarty engine, remove some obsolete zot1 stuff
[friendica.git] / library / Smarty / demo / templates / index.tpl
1 {config_load file="test.conf" section="setup"}
2 {include file="header.tpl" title=foo}
3
4 <PRE>
5
6 {* bold and title are read from the config file *}
7 {if #bold#}<b>{/if}
8 {* capitalize the first letters of each word of the title *}
9 Title: {#title#|capitalize}
10 {if #bold#}</b>{/if}
11
12 The current date and time is {$smarty.now|date_format:"%Y-%m-%d %H:%M:%S"}
13
14 The value of global assigned variable $SCRIPT_NAME is {$SCRIPT_NAME}
15
16 Example of accessing server environment variable SERVER_NAME: {$smarty.server.SERVER_NAME}
17
18 The value of {ldelim}$Name{rdelim} is <b>{$Name}</b>
19
20 variable modifier example of {ldelim}$Name|upper{rdelim}
21
22 <b>{$Name|upper}</b>
23
24
25 An example of a section loop:
26
27 {section name=outer 
28 loop=$FirstName}
29 {if $smarty.section.outer.index is odd by 2}
30         {$smarty.section.outer.rownum} . {$FirstName[outer]} {$LastName[outer]}
31 {else}
32         {$smarty.section.outer.rownum} * {$FirstName[outer]} {$LastName[outer]}
33 {/if}
34 {sectionelse}
35         none
36 {/section}
37
38 An example of section looped key values:
39
40 {section name=sec1 loop=$contacts}
41         phone: {$contacts[sec1].phone}<br>
42         fax: {$contacts[sec1].fax}<br>
43         cell: {$contacts[sec1].cell}<br>
44 {/section}
45 <p>
46
47 testing strip tags
48 {strip}
49 <table border=0>
50         <tr>
51                 <td>
52                         <A HREF="{$SCRIPT_NAME}">
53                         <font color="red">This is a  test     </font>
54                         </A>
55                 </td>
56         </tr>
57 </table>
58 {/strip}
59
60 </PRE>
61
62 This is an example of the html_select_date function:
63
64 <form>
65 {html_select_date start_year=1998 end_year=2010}
66 </form>
67
68 This is an example of the html_select_time function:
69
70 <form>
71 {html_select_time use_24_hours=false}
72 </form>
73
74 This is an example of the html_options function:
75
76 <form>
77 <select name=states>
78 {html_options values=$option_values selected=$option_selected output=$option_output}
79 </select>
80 </form>
81
82 {include file="footer.tpl"}