变量调节器
如何引用变量调节器:
<{$ | }>
例题:
main.php
1 <?php 2 include("init.inc.php"); 3 4 $aw = "m djsjkslk"; 5 6 $smarty->assign("rr",$aw); 7 8 $smarty->display("xx.html"); 9 10 11 ?>
xx.html
1 <html>
2
3 <head>
4 <meta charset="utf-8"/>
5 </head>
6
7 <body>
8 <!--引用变量-->
9 <{$rr}><br />
10
11 <!-- 首字符大写-->
12 <{$rr|capitalize}><br />
13 <!--计算字母数-->
14 <{$rr|count_characters}>
15
16
17
18 </body>
19
20 </html>
结果如图: