PageRenderTime 19ms CodeModel.GetById 13ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/framework/vendor/smarty3/lib/demo/templates/index.tpl

http://zoop.googlecode.com/
Smarty Template | 82 lines | 58 code | 22 blank | 2 comment | 0 complexity | 68a6997240995c5d8235885984bf0a2b MD5 | raw file
 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 *}
 9Title: {#title#|capitalize}
10{if #bold#}</b>{/if}
11
12The current date and time is {$smarty.now|date_format:"%Y-%m-%d %H:%M:%S"}
13
14The value of global assigned variable $SCRIPT_NAME is {$SCRIPT_NAME}
15
16Example of accessing server environment variable SERVER_NAME: {$smarty.server.SERVER_NAME}
17
18The value of {ldelim}$Name{rdelim} is <b>{$Name}</b>
19
20variable modifier example of {ldelim}$Name|upper{rdelim}
21
22<b>{$Name|upper}</b>
23
24
25An example of a section loop:
26
27{section name=outer 
28loop=$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
38An 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
47testing 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
62This 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
68This is an example of the html_select_time function:
69
70<form>
71{html_select_time use_24_hours=false}
72</form>
73
74This 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"}