?
Dieses Dokument verwendet PHP-Handbuch für chinesische Websites Freigeben
Many times web designers run into the issue where white space and carriage returns affect the output of the rendered HTML (browser "features"), so you must run all your tags together in the template to get the desired results. This usually ends up in unreadable or unmanageable templates.
Web 開發(fā)者多次遇到空格和回車影響HTML輸出的情形(瀏覽器的"特性"),為了得到特定的結(jié)果,因此你不得不在模板里運(yùn)行所有的標(biāo)簽. 通常在難以理解或難以處理的模板中遇到此問題.
Anything within {strip}{/strip} tags in Smarty are stripped of the extra spaces or carriage returns at the beginnings and ends of the lines before they are displayed. This way you can keep your templates readable, and not worry about extra white space causing problems.
Smarty 在顯示前將除區(qū)任何位于 {strip}{/strip} 標(biāo)記中數(shù)據(jù)的首尾空格和回車. 這樣可以保證模板容易理解且不用擔(dān)心多余的空格導(dǎo)致問題.
Technical Note: {strip}{/strip} does not affect the contents of template variables. See the strip modifier function.
技術(shù)要點(diǎn):
Example 7-31. strip tags
|
Notice that in the above example, all the lines begin and end with HTML tags. Be aware that all the lines are run together. If you have plain text at the beginning or end of any line, they will be run together, and may not be desired results.
請注意上例,所有行都以HTML標(biāo)簽開頭結(jié)尾. 所有行被組織到一起運(yùn)行. 如果在行首和行尾有文本的話,它們也會被組織到一起,就有可能得到你不想得到的結(jié)果.