diff options
author | friendica <info@friendica.com> | 2012-05-12 17:57:41 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2012-07-18 20:40:31 +1000 |
commit | 7a40f4354b32809af3d0cfd6e3af0eda02ab0e0a (patch) | |
tree | a9c3d91209cff770bb4b613b1b95e61a7bbc5a2b /lib/smarty/demo/templates/index.tpl | |
parent | cd727cb26b78a1dade09d510b071446898477356 (diff) | |
download | volse-hubzilla-7a40f4354b32809af3d0cfd6e3af0eda02ab0e0a.tar.gz volse-hubzilla-7a40f4354b32809af3d0cfd6e3af0eda02ab0e0a.tar.bz2 volse-hubzilla-7a40f4354b32809af3d0cfd6e3af0eda02ab0e0a.zip |
some important stuff we'll need
Diffstat (limited to 'lib/smarty/demo/templates/index.tpl')
-rw-r--r-- | lib/smarty/demo/templates/index.tpl | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/lib/smarty/demo/templates/index.tpl b/lib/smarty/demo/templates/index.tpl new file mode 100644 index 000000000..38d233412 --- /dev/null +++ b/lib/smarty/demo/templates/index.tpl @@ -0,0 +1,82 @@ +{config_load file="test.conf" section="setup"} +{include file="header.tpl" title=foo} + +<PRE> + +{* 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} + +<b>{$Name|upper}</b> + + +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]} +{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} +<table border=0> + <tr> + <td> + <A HREF="{$SCRIPT_NAME}"> + <font color="red">This is a test </font> + </A> + </td> + </tr> +</table> +{/strip} + +</PRE> + +This is an example of the html_select_date function: + +<form> +{html_select_date start_year=1998 end_year=2010} +</form> + +This is an example of the html_select_time function: + +<form> +{html_select_time use_24_hours=false} +</form> + +This is an example of the html_options function: + +<form> +<select name=states> +{html_options values=$option_values selected=$option_selected output=$option_output} +</select> +</form> + +{include file="footer.tpl"} |