Files
smarty/docs/it/designers/language-custom-functions/language-function-counter.xml

123 lines
3.1 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ -->
<sect1 id="language.function.counter">
<title>counter</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 contatore</entry>
</row>
<row>
<entry>start</entry>
<entry>numerico</entry>
<entry>no</entry>
<entry><emphasis>1</emphasis></entry>
<entry>Valore di partenza del contatore</entry>
</row>
<row>
<entry>skip</entry>
<entry>numerico</entry>
<entry>no</entry>
<entry><emphasis>1</emphasis></entry>
<entry>Passo del contatore</entry>
</row>
<row>
<entry>direction</entry>
<entry>stringa</entry>
<entry>no</entry>
<entry><emphasis>up</emphasis></entry>
<entry>Direzione del conteggio (up/down)</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>assign</entry>
<entry>stringa</entry>
<entry>no</entry>
<entry><emphasis>nessuno</emphasis></entry>
<entry>la variabile del template a cui assegnare il valore</entry>
</row>
</tbody>
</tgroup>
</informaltable>
<para>
counter si usa per stampare un conteggio. counter terrà il conto
del valore ad ogni iterazione. Potete impostare il valore di partenza,
l'intervallo e la direzione del conteggio, così come decidere se
stampare il valore oppure no. Potete utilizzare più contatori
contemporaneamente indicando un nome diverso per ciascuno. Se non indicate
un nome, verrà usato il nome 'default'.
</para>
<para>
Se fornite lo speciale attributo "assign", l'output della funzione contatore
verrà assegnato a questa variabile invece di essere stampata in output.
</para>
<example>
<title>counter</title>
<programlisting>
<![CDATA[
{* inizializzazione del contatore *}
{counter start=0 skip=2}<br />
{counter}<br />
{counter}<br />
{counter}<br />
]]>
</programlisting>
<para>
questo stamperà:
</para>
<screen>
<![CDATA[
0<br />
2<br />
4<br />
6<br />
]]>
</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
-->