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

61 lines
1.6 KiB
XML
Raw Normal View History

2004-04-13 08:46:28 +00:00
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ -->
2004-04-18 17:34:12 +00:00
<sect1 id="language.syntax.attributes">
<title>Attributes</title>
<para>
2005-05-27 16:25:02 +00:00
Most of the <link linkend="language.syntax.functions">functions</link>
take attributes that specify or modify
2004-04-18 17:34:12 +00:00
their behavior. Attributes to Smarty functions are much like HTML
attributes. Static values don't have to be enclosed in quotes, but it
is recommended for literal strings. Variables may also be used, and
should not be in quotes.
</para>
<para>
Some attributes require boolean values (true or false). These can be
specified as either unquoted <literal>true</literal>,
<literal>on</literal>, and <literal>yes</literal>, or
<literal>false</literal>, <literal>off</literal>, and
<literal>no</literal>.
</para>
<example>
<title>function attribute syntax</title>
<programlisting>
2004-04-13 08:46:28 +00:00
<![CDATA[
{include file="header.tpl"}
2005-05-27 16:25:02 +00:00
{include file="header.tpl" attrib_name="attrib value"}
2004-04-13 08:46:28 +00:00
{include file=$includeFile}
2005-05-27 16:25:02 +00:00
{include file=#includeFile# title="Smarty is cool"}
2004-04-13 08:46:28 +00:00
{html_select_date display_days=yes}
<select name="company">
2005-05-27 16:25:02 +00:00
{html_options options=$choices selected=$selected}
2004-04-13 08:46:28 +00:00
</select>
]]>
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
2004-04-18 17:34:12 +00:00
-->