Location: PHPKode > projects > Openology PHP Application Integration > openology/lib/smarty/demo/templates/index.tpl
{config_load file=test.conf section="setup"}
{include file="header.tpl" title=foo}


{* bold and title are read from the config file *}
{if #bold#}<b>{/if}
{* capitalize the first letters of each word of the title *}
Title: {#title#|capitalize}
{if #bold#}</b>{/if}

The current date and time is {$smarty.now|date_format:"%Y-%m-%d %H:%M:%S"}

The value of global assigned variable $SCRIPT_NAME is {$SCRIPT_NAME}

Example of accessing server environment variable SERVER_NAME: {$smarty.server.SERVER_NAME}

The value of {ldelim}$Name{rdelim} is <b>{$Name}</b>

variable modifier example of {ldelim}$Name|upper{rdelim}


An example of a section loop:

{section name=outer loop=$FirstName}
{if $smarty.section.outer.index is odd by 2}
	{$smarty.section.outer.rownum} . {$FirstName[outer]} {$LastName[outer]}
	{$smarty.section.outer.rownum} * {$FirstName[outer]} {$LastName[outer]}

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>

testing strip tags
<table border=0>
			<font color="red">This is a  test     </font>


This is an example of the html_select_date function:

{html_select_date start_year=1998 end_year=2010}

This is an example of the html_select_time function:

{html_select_time use_24_hours=false}

This is an example of the html_options function:

<select name=states>
{html_options values=$option_values selected=$option_selected output=$option_output}

{include file="footer.tpl"}
Return current item: Openology PHP Application Integration