2012-07-04 05:23:08 +00:00
|
|
|
{config_load file="test.conf" section="setup"}
|
|
|
|
{include file="header.tpl" title=foo}
|
|
|
|
|
|
|
|
<PRE>
|
|
|
|
|
|
|
|
{* bold and title are read from the config file *}
|
2014-09-07 11:38:28 +00:00
|
|
|
{if #bold#}<b>{/if}
|
|
|
|
{* capitalize the first letters of each word of the title *}
|
|
|
|
Title: {#title#|capitalize}
|
|
|
|
{if #bold#}</b>{/if}
|
2012-07-04 05:23:08 +00:00
|
|
|
|
2014-09-07 11:38:28 +00:00
|
|
|
The current date and time is {$smarty.now|date_format:"%Y-%m-%d %H:%M:%S"}
|
2012-07-04 05:23:08 +00:00
|
|
|
|
2014-09-07 11:38:28 +00:00
|
|
|
The value of global assigned variable $SCRIPT_NAME is {$SCRIPT_NAME}
|
2012-07-04 05:23:08 +00:00
|
|
|
|
2014-09-07 11:38:28 +00:00
|
|
|
Example of accessing server environment variable SERVER_NAME: {$smarty.server.SERVER_NAME}
|
2012-07-04 05:23:08 +00:00
|
|
|
|
2014-09-07 11:38:28 +00:00
|
|
|
The value of {ldelim}$Name{rdelim} is <b>{$Name}</b>
|
2012-07-04 05:23:08 +00:00
|
|
|
|
|
|
|
variable modifier example of {ldelim}$Name|upper{rdelim}
|
|
|
|
|
|
|
|
<b>{$Name|upper}</b>
|
|
|
|
|
|
|
|
|
|
|
|
An example of a section loop:
|
|
|
|
|
2014-09-07 11:38:28 +00:00
|
|
|
{section name=outer
|
|
|
|
loop=$FirstName}
|
|
|
|
{if $smarty.section.outer.index is odd by 2}
|
|
|
|
{$smarty.section.outer.rownum} . {$FirstName[outer]} {$LastName[outer]}
|
|
|
|
{else}
|
|
|
|
{$smarty.section.outer.rownum} * {$FirstName[outer]} {$LastName[outer]}
|
|
|
|
{/if}
|
|
|
|
{sectionelse}
|
|
|
|
none
|
|
|
|
{/section}
|
|
|
|
|
|
|
|
An example of section looped key values:
|
|
|
|
|
|
|
|
{section name=sec1 loop=$contacts}
|
|
|
|
phone: {$contacts[sec1].phone}
|
|
|
|
<br>
|
|
|
|
|
|
|
|
fax: {$contacts[sec1].fax}
|
|
|
|
<br>
|
|
|
|
|
|
|
|
cell: {$contacts[sec1].cell}
|
|
|
|
<br>
|
|
|
|
{/section}
|
|
|
|
<p>
|
|
|
|
|
|
|
|
testing strip tags
|
|
|
|
{strip}
|
2012-07-04 05:23:08 +00:00
|
|
|
<table border=0>
|
2014-09-07 11:38:28 +00:00
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
<A HREF="{$SCRIPT_NAME}">
|
|
|
|
<font color="red">This is a test </font>
|
|
|
|
</A>
|
|
|
|
</td>
|
|
|
|
</tr>
|
2012-07-04 05:23:08 +00:00
|
|
|
</table>
|
2014-09-07 11:38:28 +00:00
|
|
|
{/strip}
|
2012-07-04 05:23:08 +00:00
|
|
|
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
This is an example of the html_select_date function:
|
|
|
|
|
|
|
|
<form>
|
2014-09-07 11:38:28 +00:00
|
|
|
{html_select_date start_year=1998 end_year=2010}
|
2012-07-04 05:23:08 +00:00
|
|
|
</form>
|
|
|
|
|
|
|
|
This is an example of the html_select_time function:
|
|
|
|
|
|
|
|
<form>
|
2014-09-07 11:38:28 +00:00
|
|
|
{html_select_time use_24_hours=false}
|
2012-07-04 05:23:08 +00:00
|
|
|
</form>
|
|
|
|
|
|
|
|
This is an example of the html_options function:
|
|
|
|
|
|
|
|
<form>
|
2014-09-07 11:38:28 +00:00
|
|
|
<select name=states>
|
|
|
|
{html_options values=$option_values selected=$option_selected output=$option_output}
|
|
|
|
</select>
|
2012-07-04 05:23:08 +00:00
|
|
|
</form>
|
|
|
|
|
|
|
|
{include file="footer.tpl"}
|