strip函數(shù)
strip函數(shù):
#Web 開發(fā)者多次遇到空格和回車影響HTML輸出的情形(瀏覽器的"特性"),為了得到特定的結果,因此你不得不在模板裡運行所有的標籤.?
通常在難以理解或難以處理的模板中遇到此問題.
Smarty 在顯示前將除區(qū)任何位於{strip}{/strip} 標記中資料的首尾空格和回車.
?這樣可以確保模板容易理解且不用擔心多餘的空格導致問題.
eg:
{strip}
<table border=0>
????<tr>
????????{$url}">
????????????????<font color="red">This is a test</font>#?&/lt;This is a test<??</td>
????</ tr>
</table>
{/strip}
#輸出:
<table border=0><tr><td>< ;A ><font color="red">This is a test</font></A></td></tr> </table>
#