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

107 lines
2.5 KiB
XML
Raw Normal View History

<?xml version="1.0" encoding="UTF-8"?>
2004-04-13 08:46:28 +00:00
<!-- $Revision$ -->
2004-04-18 17:34:12 +00:00
<sect1 id="language.syntax.comments">
<title>Comments</title>
<para>
Template comments are surrounded by asterisks, and that is surrounded
2005-05-27 16:25:02 +00:00
by the
2006-03-27 23:57:45 +00:00
<link linkend="variable.left.delimiter">delimiter</link>
2006-10-09 22:50:41 +00:00
tags like so:
</para>
<informalexample>
<programlisting>
<![CDATA[
{* this is a comment *}
]]>
</programlisting>
</informalexample>
<para>
2005-05-27 16:25:02 +00:00
Smarty comments are NOT displayed in the final output of the template,
2006-10-09 22:50:41 +00:00
unlike <literal>&lt;!-- HTML comments --&gt;</literal>.
These are useful for making internal notes in the templates which no one will see ;-)
2004-04-18 17:34:12 +00:00
</para>
<example>
2006-03-27 23:57:45 +00:00
<title>Comments within a template</title>
2004-04-18 17:34:12 +00:00
<programlisting>
2004-04-13 08:46:28 +00:00
<![CDATA[
2006-03-15 00:41:59 +00:00
{* I am a Smarty comment, I don't exist in the compiled output *}
2006-03-27 23:57:45 +00:00
<html>
2006-03-28 00:27:52 +00:00
<head>
2006-03-27 23:57:45 +00:00
<title>{$title}</title>
2006-03-28 00:27:52 +00:00
</head>
2006-03-27 23:57:45 +00:00
<body>
2005-09-13 19:32:43 +00:00
2006-03-15 00:41:59 +00:00
{* another single line smarty comment *}
<!-- HTML comment that is sent to the browser -->
2006-03-07 02:00:17 +00:00
2006-09-26 02:42:08 +00:00
{* this multiline smarty
comment is
2005-05-27 16:25:02 +00:00
not sent to browser
*}
2004-04-13 08:46:28 +00:00
2006-03-15 00:41:59 +00:00
{*********************************************************
Multi line comment block with credits block
@ author: bg@example.com
@ maintainer: support@example.com
2006-09-26 02:42:08 +00:00
@ para: var that sets block style
2006-03-15 00:41:59 +00:00
@ css: the style output
**********************************************************}
2006-09-26 02:42:08 +00:00
2006-03-27 23:57:45 +00:00
{* The header file with the main logo and stuff *}
2006-02-18 13:43:35 +00:00
{include file='header.tpl'}
2004-04-13 08:46:28 +00:00
2005-05-27 16:25:02 +00:00
2006-03-27 23:57:45 +00:00
{* Dev note: the $includeFile var is assigned in foo.php script *}
<!-- Displays main content block -->
2004-04-13 08:46:28 +00:00
{include file=$includeFile}
2005-09-13 19:32:43 +00:00
{* this <select> block is redundant *}
{*
2004-04-13 08:46:28 +00:00
<select name="company">
2005-05-27 16:25:02 +00:00
{html_options options=$vals selected=$selected_id}
2004-04-13 08:46:28 +00:00
</select>
2005-09-13 19:32:43 +00:00
*}
2006-02-18 13:43:35 +00:00
2006-10-09 22:50:41 +00:00
<!-- Show header from affiliate is disabled -->
{* $affiliate|upper *}
{* you cannot nest comments *}
{*
<select name="company">
{* <option value="0">-- none -- </option> *}
{html_options options=$vals selected=$selected_id}
</select>
*}
2006-09-26 02:42:08 +00:00
{* cvs tag for a template, below the 36 SHOULD be an american currency
2006-03-27 23:57:45 +00:00
. however its converted in cvs.. *}
2006-03-17 11:30:37 +00:00
{* &#36;Id: Exp &#36; *}
2006-03-27 23:57:45 +00:00
{* $Id: *}
2005-05-27 16:25:02 +00:00
</body>
2006-03-28 00:27:52 +00:00
</html>
2004-04-13 08:46:28 +00:00
]]>
2004-04-18 17:34:12 +00:00
</programlisting>
</example>
2004-04-13 08:46:28 +00:00
</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
-->