Files
smarty/docs/en/designers/language-variables.xml

66 lines
1.8 KiB
XML
Raw Normal View History

2004-03-28 15:15:38 +00:00
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ -->
2004-04-18 17:30:04 +00:00
<chapter id="language.variables">
<title>Variables</title>
<para>
Smarty has several different types of variables. The type of the variable
2005-05-27 16:25:02 +00:00
depends on what symbol it is prefixed or enclosed within.
2004-04-18 17:30:04 +00:00
</para>
<para>
Variables in Smarty can be either displayed directly or used as arguments
2006-09-26 03:45:51 +00:00
for <link linkend="language.syntax.functions">functions</link>,
2005-05-27 16:25:02 +00:00
<link linkend="language.syntax.attributes">attributes</link> and
<link linkend="language.modifiers">modifiers</link>, inside conditional expressions,
etc. To print a variable, simply enclose it in the
<link linkend="variable.left.delimiter">delimiters</link> so that it
2006-09-26 03:44:02 +00:00
is the only thing contained between them.
<example>
<title>Example variables</title>
2004-04-18 17:30:04 +00:00
<programlisting>
2004-03-28 16:48:54 +00:00
<![CDATA[
2004-03-28 15:15:38 +00:00
{$Name}
2006-09-26 03:44:02 +00:00
{$product.part_no} <b>{$product.description}</b>
2004-03-28 15:15:38 +00:00
{$Contacts[row].Phone}
2004-03-28 16:48:54 +00:00
<body bgcolor="{#bgcolor#}">
]]>
2004-04-18 17:30:04 +00:00
</programlisting>
2006-09-26 03:44:02 +00:00
</example>
<note>
<title>Top Tip</title>
<para>As easy way to examine Smarty variables is with the
<link linkend="chapter.debugging.console">debugging console</link>.
</para>
</note>
2004-04-18 17:30:04 +00:00
</para>
2004-03-28 15:15:38 +00:00
2006-09-26 03:44:02 +00:00
2004-04-18 17:30:04 +00:00
&designers.language-variables.language-assigned-variables;
&designers.language-variables.language-config-variables;
&designers.language-variables.language-variables-smarty;
2004-03-28 15:15:38 +00:00
</chapter>
2004-03-28 16:48:54 +00:00
2004-03-28 15:15:38 +00:00
<!-- 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-03-28 16:48:54 +00:00
-->