Get Smarty

Smarty Icon

You may use the Smarty logo according to the trademark notice.

Smarty Template Engine Smarty Template Engine

For sponsorship, advertising, news or other inquiries, contact us at:

Check reviews of PHP Web Hosting, compatible with Smarty Templates

{strip}

Webデザイナーの方は、HTML コードに含まれたホワイトスペースとキャリッジリターンが ブラウザの表示に影響を及ぼす問題に何度も遭遇した事があると思います。 問題を回避するには、テンプレートの全てのタグを連ねて記述する必要があります。 しかしこれでは大変読みづらく管理しにくいテンプレートになってしまいます。

{strip}{/strip} タグに囲まれたコンテンツは、 ブラウザに表示される前に、各行の先頭と終端にある 余分なホワイトスペースやキャリッジリターンが除去されます。 これによってテンプレートは可読性を維持し、 余分なホワイトスペースによって問題を引き起こす心配もありません。

Note

{strip}{/strip} はテンプレート変数の内容に影響しません。 詳細は strip 修飾子 を参照してください。

Example 7.44. {strip} タグ


{* 次の例は全て1行に出力されます  *}
{strip}
<table border='0'>
 <tr>
  <td>
   <a href="{$url}">
    <font color="red">This is a test</font>
   </a>
  </td>
 </tr>
</table>
{/strip}

  

上の例の出力


<table border='0'><tr><td><a href="http://. snipped...</a></td></tr></table>

  

上記の例は、全ての行が HTML タグで始まり HTML タグで終わる事に注意して下さい。 全ての行は連ねて出力されます。行の始めか終わりにプレーンテキストがある場合は、 連続して出力されたその結果は望むものではないかもしれません。

strip 修飾子も参照してください。

Comments
No comments for this page.
Post a Comment
All comments are moderated. Support questions are ignored, use the forums instead.
Author:
Email: (not shown)
What is 19 plus 7? (Are you human?)

Sponsors [info]

Cheap Website Hosting @hostdone.com
email marketing @ActiveCampaign
broadband deals @BroadbandGenie
Best UK Web Hosting @webhost.uk.net
Reliable UK and US Web Hosting @rshosting.com
Cheap US and UK Web Hosting @infrenion.com
I.T Certification Exams @pass-guaranteed.com
Certification Practice Tests @firsttrycertify.com
Certification Practice Exam Questions @ace-it-certifications.com
Broadband Speed Test @broadbandspeed.co.uk
bulk email software @americaint.com
ASP.NET hosting @aspnethosting.co.uk