2001-08-06 22:46:41 +00:00
{ config_load file = test . conf section = "setup" }
2001-01-30 18:06:14 +00:00
{ include file = header . tpl title = foo }
2000-11-20 20:06:06 +00:00
2001-01-18 20:41:43 +00:00
<PRE>
2001-01-18 22:38:49 +00:00
{ * bold and title are read from the config file * }
{ if #bold# } <b> { /if }
2001-02-09 19:54:47 +00:00
{ * capitalize the first letters of each word of the title * }
2000-11-20 22:31:38 +00:00
Title: { #title# | capitalize }
2001-01-18 22:38:49 +00:00
{ if #bold# } </b> { /if }
2000-11-20 20:06:06 +00:00
2001-08-09 19:56:10 +00:00
The current date and time is { $smarty.now | date_format : "%Y-%m-%d %H:%M:%S" }
2001-07-06 15:46:51 +00:00
Tooltip example: Move your mouse over the <A HREF="" { popup sticky = true caption = "Smarty pop-up text" delay = 4 0 0 text = "This is an example of a tooltip. Tooltips are handy for context sensitive information, and extremely easy to add to your templates with Smarty and the integration of <a href='http://www.bosrup.com/web/overlib/'>overLIB</a> by Erik Bosrup" } onclick="return false;">Help</A> link to see an example of a tooltip using Smarty's popup function.
2001-06-29 19:35:06 +00:00
2001-07-06 15:46:51 +00:00
The value of global assigned variable $SCRIPT_NAME is { $SCRIPT_NAME }
2000-11-22 16:23:19 +00:00
2001-07-06 15:46:51 +00:00
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 }
<b> { $Name | upper } </b>
An example of a section loop:
2000-11-20 20:06:06 +00:00
2001-01-22 15:29:36 +00:00
{ section name = outer loop = $FirstName }
2001-02-22 21:25:19 +00:00
{ if % outer . index % is odd by 2 }
2001-04-16 17:39:59 +00:00
{ % outer . rownum % } . { $FirstName [ outer ] } { $LastName [ outer ] }
2001-02-22 21:25:19 +00:00
{ else }
2001-04-16 17:39:59 +00:00
{ % outer . rownum % } * { $FirstName [ outer ] } { $LastName [ outer ] }
2001-02-22 21:25:19 +00:00
{ /if }
2000-11-20 03:20:55 +00:00
{ sectionelse }
none
{ /section }
2000-11-21 20:29:55 +00:00
2001-07-06 15:46:51 +00:00
An example of section looped key values:
2001-01-26 15:15:55 +00:00
{ section name = sec1 loop = $contacts }
2001-04-16 17:39:59 +00:00
phone: { $contacts [ sec1 ] . phone } <br>
fax: { $contacts [ sec1 ] . fax } <br>
cell: { $contacts [ sec1 ] . cell } <br>
2001-01-26 15:15:55 +00:00
{ /section }
2001-01-18 22:38:49 +00:00
<p>
2001-01-04 21:39:51 +00:00
testing strip tags
{ strip }
<table border=0>
<tr>
<td>
2001-01-18 22:38:49 +00:00
<A HREF=" { $SCRIPT_NAME } ">
2001-01-04 21:39:51 +00:00
<font color="red">This is a test </font>
</A>
</td>
</tr>
</table>
{ /strip }
2001-01-18 20:41:43 +00:00
2001-02-12 16:01:55 +00:00
</PRE>
2001-02-09 19:54:47 +00:00
This is an example of the html_select_date function:
<form>
{ html_select_date start_year = 1 9 9 8 end_year = 2 0 1 0 }
</form>
2001-03-28 15:30:56 +00:00
This is an example of the html_select_time function:
<form>
{ html_select_time use_24_hours = false }
</form>
2001-02-09 19:54:47 +00:00
This is an example of the html_options function:
2001-03-02 21:38:42 +00:00
2001-02-09 19:54:47 +00:00
<form>
<select name=states>
{ html_options values = $option_values selected = $option_selected output = $option_output }
</select>
</form>
2001-04-11 18:35:17 +00:00
{ include file = "footer.tpl" }