Files
smarty/docs/ja/designers/language-basic-syntax/language-syntax-comments.xml

109 lines
3.1 KiB
XML
Raw Normal View History

2007-04-21 12:13:34 +00:00
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: 1.14 Maintainer: takagi Status: ready -->
<!-- CREDITS: mat-sh,daichi,joe -->
<sect1 id="language.syntax.comments">
<title>コメント</title>
<para>
テンプレートのコメントはまずアスタリスクで囲まれ、次にそれを
<link linkend="variable.left.delimiter">デリミタ</link>
タグで囲みます。このような形式になります。
</para>
<informalexample>
<programlisting>
<![CDATA[
{* これはコメントです *}
]]>
</programlisting>
</informalexample>
<para>
Smarty のコメントは、テンプレートの最終的な出力には表示されません。この点は
<literal>&lt;!-- HTML のコメント --&gt;</literal> とは異なります。
これは、テンプレート内での内部的なメモとして使用するのに便利です。
誰にもバレません ;-)
</para>
<example>
<title>テンプレート内のコメント</title>
<programlisting>
<![CDATA[
{* これは Smarty コメントです。コンパイルされた結果には登場しません。 *}
<html>
<head>
<title>{$title}</title>
</head>
<body>
{* 別の Smarty コメント *}
<!-- HTML コメント。これはブラウザに送信されます -->
{* この、複数行の
Smarty コメントは
ブラウザへは送信されません
*}
{*********************************************************
クレジットブロックを含む複数行のコメント
@ author: bg@example.com
@ maintainer: support@example.com
@ para: var that sets block style
@ css: the style output
**********************************************************}
{* メインロゴなどを含むヘッダファイル *}
{include file='header.tpl'}
{* 開発メモ: 変数 $includeFile の値は foo.php で設定されています *}
<!-- 本体コンテンツブロックを表示します -->
{include file=$includeFile}
{* この <select> ブロックは余分 *}
{*
<select name="company">
{html_options options=$vals selected=$selected_id}
</select>
*}
<!-- アフィリエイトのヘッダは無効にします -->
{* $affiliate|upper *}
{* コメントを入れ子にすることはできません *}
{*
<select name="company">
{* <option value="0">-- none -- </option> *}
{html_options options=$vals selected=$selected_id}
</select>
*}
{* テンプレート用の cvs タグ。以下の 36 はアメリカの通貨記号ですが、
. cvs がこれを変換してしまいます…… *}
{* &#36;Id: Exp &#36; *}
{* $Id: *}
</body>
</html>
]]>
</programlisting>
</example>
</sect1>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->