1.capitalize 首字母大写
eg:capitalize.php //***php文件
<?phpinclude 'libs/Smarty.class.php';
$smarty=new Smarty();
$smarty->template_dir="demo/templates";//设置模版目录
$smarty->compile_dir="demo/templates_c";//设置编译目录
//***********************************
//设置定界符
//*************************
$smarty->left_delimiter="<{";
$smarty->right_delimiter="}>";
$ac="hello world";
$smarty->assign('ack',$ac);
$smarty->display("capitalize.tpl");
?>
capitalize.tpl //****模版文件
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<body>
<{$ack|capitalize}>;
</body>
</html>
2、count_characters[字符计数]
eg:count_characters.php //***php文件
<?phpinclude 'libs/Smarty.class.php';
$smarty=new Smarty();
$smarty->template_dir="demo/templates";//设置模版目录
$smarty->compile_dir="demo/templates_c";//设置编译目录
//***********************************
//设置定界符
//*************************
$smarty->left_delimiter="<{";
$smarty->right_delimiter="}>";
$ac="hello world";
$smarty->assign('ack',$ac);
$smarty->display("count_characters.tpl");
?>
count_characters.tpl //****模版文件
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<body>
<{$ack|count_characters}>;//字符计数不计空格
<{$ack|count_characters:true}>;//字符计数算上空格
</body>
</html>
3、cat[连接字符串]
eg.同上 代码相同 不同点是
<{$ack|cat:"***"}> //实现效果是:实现hello world***
4、count_paragraphs[计算段数] //计算变量里的段落数量。
5、count_sentences[计算句数] //计算变量里句子的数量。
6、count_words[计算词数] //计算变量里的词数。
7.date_format[格式化日期] //
<{$smarty.now|date_format:"%A, %B %e, %Y"}>;
<{$smarty.now|date_format:"%H:%M:%S"}>;
<{$yesterday|date_format:"%A, %B %e, %Y"}>
程序员提示:date_format本质上是php的strftime()函数的一个包装。
当php被编译的时候你可以或多或少的依靠系统的strftime()转换有效的区分符。
***关于区分符*可以查看系统手册的有效区分符的全表.
8、default[默认值] //这是变量为空的时候的默认输出(当没有变量的值的时候就按默认的输出)。
eg、<{$myTitle|default:"no title"}>
9、escape[编码] //使用何种编码格式。