mirror of
https://github.com/smarty-php/smarty.git
synced 2025-11-06 07:11:37 +01:00
124 lines
3.1 KiB
XML
124 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>Nombre del Atributo</entry>
|
|
<entry>Tipo</entry>
|
|
<entry>Requerido</entry>
|
|
<entry>Default</entry>
|
|
<entry>Descripción</entry>
|
|
</row>
|
|
</thead>
|
|
<tbody>
|
|
<row>
|
|
<entry>name</entry>
|
|
<entry>string</entry>
|
|
<entry>No</entry>
|
|
<entry><emphasis>default</emphasis></entry>
|
|
<entry>El nombre del contador</entry>
|
|
</row>
|
|
<row>
|
|
<entry>start</entry>
|
|
<entry>number</entry>
|
|
<entry>No</entry>
|
|
<entry><emphasis>1</emphasis></entry>
|
|
<entry>El número inicial para contar a partir de</entry>
|
|
</row>
|
|
<row>
|
|
<entry>skip</entry>
|
|
<entry>number</entry>
|
|
<entry>No</entry>
|
|
<entry><emphasis>1</emphasis></entry>
|
|
<entry>El intervalo para contar</entry>
|
|
</row>
|
|
<row>
|
|
<entry>direction</entry>
|
|
<entry>string</entry>
|
|
<entry>No</entry>
|
|
<entry><emphasis>up</emphasis></entry>
|
|
<entry>La dirección para contar (up/down)</entry>
|
|
</row>
|
|
<row>
|
|
<entry>print</entry>
|
|
<entry>boolean</entry>
|
|
<entry>No</entry>
|
|
<entry><emphasis>true</emphasis></entry>
|
|
<entry>Cuando mostrar o no el valor</entry>
|
|
</row>
|
|
<row>
|
|
<entry>assign</entry>
|
|
<entry>string</entry>
|
|
<entry>No</entry>
|
|
<entry><emphasis>n/a</emphasis></entry>
|
|
<entry>La variable del template que va a recibir la salida</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</informaltable>
|
|
<para>
|
|
counter es usada para mostrar un conteo. counter va a depender del
|
|
conteo en cada iteración. Usted puede ajustar el número, el intervalo
|
|
y la dirección del conteo, asi como determinar cuando mostrar o no el
|
|
conteo. Usted puede tener varios contadores al mismo tiempo, dando un
|
|
nombre único para cada uno. Si usted no da un nombre, sera usado
|
|
'default' como nombre.
|
|
</para>
|
|
<para>
|
|
Si usted indica el atributo especial "assign", la salida de la función
|
|
counter se ira para esa variable del template en vez de ser mostrada en
|
|
el template.
|
|
</para>
|
|
<example>
|
|
<title>counter</title>
|
|
<programlisting>
|
|
<![CDATA[
|
|
{* Inicia el conteo *}
|
|
{counter start=0 skip=2}<br />
|
|
{counter}<br />
|
|
{counter}<br />
|
|
{counter}<br />
|
|
]]>
|
|
</programlisting>
|
|
<para>
|
|
Esta es la salida:
|
|
</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
|
|
-->
|