mirror of
				https://github.com/smarty-php/smarty.git
				synced 2025-11-04 06:11:37 +01:00 
			
		
		
		
	
		
			
	
	
		
			136 lines
		
	
	
		
			3.6 KiB
		
	
	
	
		
			XML
		
	
	
	
	
	
		
		
			
		
	
	
			136 lines
		
	
	
		
			3.6 KiB
		
	
	
	
		
			XML
		
	
	
	
	
	
| 
								 | 
							
								<?xml version="1.0" encoding="iso-8859-1"?>
							 | 
						|||
| 
								 | 
							
								<!-- $Revision$ -->
							 | 
						|||
| 
								 | 
							
								<sect1 id="language.function.cycle">
							 | 
						|||
| 
								 | 
							
								 <title>cycle</title>
							 | 
						|||
| 
								 | 
							
								 <informaltable frame="all">
							 | 
						|||
| 
								 | 
							
								  <tgroup cols="5">
							 | 
						|||
| 
								 | 
							
								   <colspec colname="param" align="center" />
							 | 
						|||
| 
								 | 
							
								   <colspec colname="type" align="center" />
							 | 
						|||
| 
								 | 
							
								   <colspec colname="required" align="center" />
							 | 
						|||
| 
								 | 
							
								   <colspec colname="default" align="center" />
							 | 
						|||
| 
								 | 
							
								   <colspec colname="desc" />
							 | 
						|||
| 
								 | 
							
								   <thead>
							 | 
						|||
| 
								 | 
							
								    <row>
							 | 
						|||
| 
								 | 
							
								     <entry>Nome Attributo</entry>
							 | 
						|||
| 
								 | 
							
								     <entry>Tipo</entry>
							 | 
						|||
| 
								 | 
							
								     <entry>Obbligatorio</entry>
							 | 
						|||
| 
								 | 
							
								     <entry>Default</entry>
							 | 
						|||
| 
								 | 
							
								     <entry>Descrizione</entry>
							 | 
						|||
| 
								 | 
							
								    </row>
							 | 
						|||
| 
								 | 
							
								   </thead>
							 | 
						|||
| 
								 | 
							
								   <tbody>
							 | 
						|||
| 
								 | 
							
								    <row>
							 | 
						|||
| 
								 | 
							
								     <entry>name</entry>
							 | 
						|||
| 
								 | 
							
								     <entry>stringa</entry>
							 | 
						|||
| 
								 | 
							
								     <entry>no</entry>
							 | 
						|||
| 
								 | 
							
								     <entry><emphasis>default</emphasis></entry>
							 | 
						|||
| 
								 | 
							
								     <entry>Nome del ciclo</entry>
							 | 
						|||
| 
								 | 
							
								    </row>
							 | 
						|||
| 
								 | 
							
								    <row>
							 | 
						|||
| 
								 | 
							
								     <entry>values</entry>
							 | 
						|||
| 
								 | 
							
								     <entry>misto</entry>
							 | 
						|||
| 
								 | 
							
								     <entry>s<EFBFBD></entry>
							 | 
						|||
| 
								 | 
							
								     <entry><emphasis>nessuno</emphasis></entry>
							 | 
						|||
| 
								 | 
							
								     <entry>Valori da usare nel ciclo: pu<70> essere
							 | 
						|||
| 
								 | 
							
								     una lista delimitata da un separatore (vedere attributo
							 | 
						|||
| 
								 | 
							
								     delimiter), oppure un array di valori.</entry>
							 | 
						|||
| 
								 | 
							
								    </row>
							 | 
						|||
| 
								 | 
							
								    <row>
							 | 
						|||
| 
								 | 
							
								     <entry>print</entry>
							 | 
						|||
| 
								 | 
							
								     <entry>booleano</entry>
							 | 
						|||
| 
								 | 
							
								     <entry>no</entry>
							 | 
						|||
| 
								 | 
							
								     <entry><emphasis>true</emphasis></entry>
							 | 
						|||
| 
								 | 
							
								     <entry>Se stampare il valore oppure no.</entry>
							 | 
						|||
| 
								 | 
							
								    </row>
							 | 
						|||
| 
								 | 
							
								    <row>
							 | 
						|||
| 
								 | 
							
								     <entry>advance</entry>
							 | 
						|||
| 
								 | 
							
								     <entry>booleano</entry>
							 | 
						|||
| 
								 | 
							
								     <entry>no</entry>
							 | 
						|||
| 
								 | 
							
								     <entry><emphasis>true</emphasis></entry>
							 | 
						|||
| 
								 | 
							
								     <entry>Se avanzare o no al prossimo valore.</entry>
							 | 
						|||
| 
								 | 
							
								    </row>
							 | 
						|||
| 
								 | 
							
								    <row>
							 | 
						|||
| 
								 | 
							
								     <entry>delimiter</entry>
							 | 
						|||
| 
								 | 
							
								     <entry>stringa</entry>
							 | 
						|||
| 
								 | 
							
								     <entry>no</entry>
							 | 
						|||
| 
								 | 
							
								     <entry><emphasis>,</emphasis></entry>
							 | 
						|||
| 
								 | 
							
								     <entry>Delimitatore per l'attributo values.</entry>
							 | 
						|||
| 
								 | 
							
								    </row>
							 | 
						|||
| 
								 | 
							
								    <row>
							 | 
						|||
| 
								 | 
							
								     <entry>assign</entry>
							 | 
						|||
| 
								 | 
							
								     <entry>stringa</entry>
							 | 
						|||
| 
								 | 
							
								     <entry>no</entry>
							 | 
						|||
| 
								 | 
							
								     <entry><emphasis>nessuno</emphasis></entry>
							 | 
						|||
| 
								 | 
							
								     <entry>Variabile del template cui assegnare l'output.</entry>
							 | 
						|||
| 
								 | 
							
								    </row>
							 | 
						|||
| 
								 | 
							
								   </tbody>
							 | 
						|||
| 
								 | 
							
								  </tgroup>
							 | 
						|||
| 
								 | 
							
								 </informaltable>
							 | 
						|||
| 
								 | 
							
								 <para>
							 | 
						|||
| 
								 | 
							
								  Cycle si usa per effettuare un ciclo alternato fra un insieme di valori. 
							 | 
						|||
| 
								 | 
							
								  Ci d<> la possibilit<69> di alternare facilmente due o pi<70> colori in una 
							 | 
						|||
| 
								 | 
							
								  tabella, o di effettuare un ciclo su un array di valori.
							 | 
						|||
| 
								 | 
							
								 </para>
							 | 
						|||
| 
								 | 
							
								 <para>
							 | 
						|||
| 
								 | 
							
								  Potete effettuare il ciclo su pi<70> di un insieme di valori nel template 
							 | 
						|||
| 
								 | 
							
								  fornendo l'attributo name, se date ad ogni insieme un nome diverso.
							 | 
						|||
| 
								 | 
							
								 </para>
							 | 
						|||
| 
								 | 
							
								 <para>
							 | 
						|||
| 
								 | 
							
								  Potete evitare che il valore corrente venga stampato impostando 
							 | 
						|||
| 
								 | 
							
								  l'attributo set a false. Pu<50> essere utile per saltare un valore.
							 | 
						|||
| 
								 | 
							
								 </para>
							 | 
						|||
| 
								 | 
							
								 <para>
							 | 
						|||
| 
								 | 
							
								  L'attributo advance serve per ripetere un valore. Se lo impostate a
							 | 
						|||
| 
								 | 
							
								  false, l'iterazione successiva del ciclo stamper<65> lo stesso valore.
							 | 
						|||
| 
								 | 
							
								 </para>
							 | 
						|||
| 
								 | 
							
								 <para>
							 | 
						|||
| 
								 | 
							
								  Se fornite lo speciale attributo "assign", l'output della funzione cycle
							 | 
						|||
| 
								 | 
							
								  verr<72> assegnato a questa variabile invece di essere stampato in output.
							 | 
						|||
| 
								 | 
							
								 </para>
							 | 
						|||
| 
								 | 
							
								 <example>
							 | 
						|||
| 
								 | 
							
								  <title>cycle</title>
							 | 
						|||
| 
								 | 
							
								  <programlisting>
							 | 
						|||
| 
								 | 
							
								<![CDATA[
							 | 
						|||
| 
								 | 
							
								{section name=rows loop=$data}
							 | 
						|||
| 
								 | 
							
								<tr bgcolor="{cycle values="#eeeeee,#d0d0d0"}">
							 | 
						|||
| 
								 | 
							
								   <td>{$data[rows]}</td>
							 | 
						|||
| 
								 | 
							
								</tr>
							 | 
						|||
| 
								 | 
							
								{/section}
							 | 
						|||
| 
								 | 
							
								]]>
							 | 
						|||
| 
								 | 
							
								  </programlisting>
							 | 
						|||
| 
								 | 
							
								  <screen>
							 | 
						|||
| 
								 | 
							
								<![CDATA[
							 | 
						|||
| 
								 | 
							
								<tr bgcolor="#eeeeee">
							 | 
						|||
| 
								 | 
							
								   <td>1</td>
							 | 
						|||
| 
								 | 
							
								</tr>
							 | 
						|||
| 
								 | 
							
								<tr bgcolor="#d0d0d0">
							 | 
						|||
| 
								 | 
							
								   <td>2</td>
							 | 
						|||
| 
								 | 
							
								</tr>
							 | 
						|||
| 
								 | 
							
								<tr bgcolor="#eeeeee">
							 | 
						|||
| 
								 | 
							
								   <td>3</td>
							 | 
						|||
| 
								 | 
							
								</tr>
							 | 
						|||
| 
								 | 
							
								]]>
							 | 
						|||
| 
								 | 
							
								  </screen>
							 | 
						|||
| 
								 | 
							
								 </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
							 | 
						|||
| 
								 | 
							
								-->
							 |