mirror of
				https://github.com/smarty-php/smarty.git
				synced 2025-10-31 20:31:41 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			66 lines
		
	
	
		
			1.8 KiB
		
	
	
	
		
			XML
		
	
	
	
	
	
			
		
		
	
	
			66 lines
		
	
	
		
			1.8 KiB
		
	
	
	
		
			XML
		
	
	
	
	
	
| <?xml version="1.0" encoding="iso-8859-1"?>
 | |
| <!-- $Revision$ -->
 | |
| <chapter id="language.variables">
 | |
|  <title>Variables</title>
 | |
|  <para>
 | |
|   Smarty has several different types of variables. The type of the variable
 | |
|   depends on what symbol it is prefixed or enclosed within.
 | |
|  </para>
 | |
|  <para>
 | |
|   Variables in Smarty can be either displayed directly or used as arguments
 | |
|   for <link linkend="language.syntax.functions">functions</link>,
 | |
|   <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
 | |
|   is the only thing contained between them.
 | |
| <example>
 | |
| <title>Example variables</title>
 | |
|   <programlisting>
 | |
| <![CDATA[
 | |
| {$Name}
 | |
| 
 | |
| {$product.part_no} <b>{$product.description}</b>
 | |
| 
 | |
| {$Contacts[row].Phone}
 | |
| 
 | |
| <body bgcolor="{#bgcolor#}">
 | |
| ]]>
 | |
|   </programlisting>
 | |
| </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>
 | |
|  </para>
 | |
| 
 | |
| 
 | |
|  &designers.language-variables.language-assigned-variables;
 | |
|  &designers.language-variables.language-config-variables;
 | |
|  &designers.language-variables.language-variables-smarty;
 | |
| 
 | |
| </chapter>
 | |
| 
 | |
| <!-- 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
 | |
| -->
 |