smarty變量調節和應用 18.5.2

 

 cat 鏈接字符串orm

 

  <{$var|upper|cat:"test is a aa <br>"|cat:"hello word <br>"}> blog

 

 $var 大寫而且後面加上  "test is a aa  hello word "字符串字符串

 

 date_format  格式化日期form

 <{$smarty.now|date_format:"%H-%y-%d  "}> <br>  test

當前時間 年月日bfc

 

regex_replace 正則替換date

<{$var|regex_replace:"/\d/":"#"}> <br>im

$var 中全部數字換成#d3

 

truncate截取smarty

  <{$var|truncate:30:"..."}> <br>  

截取 $var 30個字符串 後面寫...

相關文章
相關標籤/搜索