<{foreach key=key item=MMSPAN from=$TSortUrl}>
< ;{if $mysort eq $key}>
img src="images/sort_<{$key}>_1.gif" height="25" border="0" />
<{else}>
<{/if}>
<{/foreach}> ;
< ;{if $mysort eq $key}>
img src="images/sort_<{$key}>_1.gif" height="25" border="0" />
<{else}>
<{/if}>
<{/foreach}> ;
If there is a need for dynamic replacement in the template, such as user login information, the best thing is to call js Mainly The parameter configuration is:
include_once(IncludeFile."/libs/Smarty.class.php");
$tpl = new Smarty();
$tpl->caching= false; //True turns on caching
//$tpl->compile_check=true;//Confirm that the template will no longer be compiled in the future, change it to false
$tpl->template_dir = IncludeFile . "/templates/".Isite_tpl."/";
$tpl->compile_dir = IncludeFile . "/templates_c/";
$tpl->config_dir = IncludeFile . "/configs/";
$tpl->cache_dir = IncludeFile . "/cache/" ;
$tpl->left_delimiter = <{;
$tpl->right_delimiter = }>;
/*
Among them, the commonly used 2 methods //$tpl->compile_check=true;//Confirm that the template will no longer be compiled in the future, change it to false
$tpl->template_dir = IncludeFile . "/templates/".Isite_tpl."/";
$tpl->compile_dir = IncludeFile . "/templates_c/";
$tpl->config_dir = IncludeFile . "/configs/";
$tpl->cache_dir = IncludeFile . "/cache/" ;
$tpl->left_delimiter = <{;
$tpl->right_delimiter = }>;
/*
template_exists($f)
, used to detect whether $f template exists. fetch() is used to return the output file of the assigned template, which is very useful when generating static pages. Take a look at smarty’s own chm file description. In addition to the basic syntax, it depends on your flexible use:
Passing parameters:
<{include file="SiteAllTop.html" mysort ="0" }>
<{if $MMSPAN[0] eq $smarty.get.s}>selected<{/if}>
Clear all html formats:
<{$OReDetail[6]|strip_tags}>
Notes:
{* Smarty *}
{* include the header file here *}
{include file="header.tpl"}
Mathematical operators and interception: {include file="header.tpl"}
{$foo|truncate:"`$fooTruncCount/$barTruncFactor-1`"}
{$smarty.now|date_format}
{$smarty.now|date_format:"%A, %B %e, %Y"}
{$smarty.now|date_format:"%H: %M:%S"}
{$yesterday|date_format}
{$yesterday|date_format:"%A, %B %e, %Y"}
{$yesterday|date_format:"%H :%M:%S"}
OUTPUT:
Feb 6, 2001
Tuesday, February 6, 2001
14:33:00
Feb 5, 2001
Monday, February 5, 2001
14:33:00
Regular use:
{$yesterday|date_format}
{$yesterday|date_format:"%A, %B %e, %Y"}
{$yesterday|date_format:"%H :%M:%S"}
OUTPUT:
Feb 6, 2001
Tuesday, February 6, 2001
14:33:00
Feb 5, 2001
Monday, February 5, 2001
14:33:00
{* Replace each carriage return, tab, and line feed with a space *}
{$articleTitle}
{$articleTitle|regex_replace:"/[
]/":" "}
Format string: {textformat wrap=40 indent=4}
<{/if}>