mirror of
https://github.com/smarty-php/smarty.git
synced 2025-11-02 13:21:36 +01:00
added italian docs. thanks to Gianluca Gillini
This commit is contained in:
@@ -0,0 +1,90 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.modifier.capitalize">
|
||||
<title>capitalize</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>Posizione del Parametro</entry>
|
||||
<entry>Tipo</entry>
|
||||
<entry>Obbligatorio</entry>
|
||||
<entry>Default</entry>
|
||||
<entry>Descrizione</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>1</entry>
|
||||
<entry>booleano</entry>
|
||||
<entry>No</entry>
|
||||
<entry>false</entry>
|
||||
<entry>Stabilisce se le parole contenenti cifre verranno
|
||||
trasformate in maiuscolo</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
Si usa per mettere in maiuscolo la prima lettera di tutte le parole nella variabile.
|
||||
</para>
|
||||
<example>
|
||||
<title>capitalize</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('articleTitle', 'next x-men film, x3, delayed.');
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Dove index.tpl <20>:
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{$articleTitle}
|
||||
{$articleTitle|capitalize}
|
||||
{$articleTitle|capitalize:true}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Questo stamper<65>:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
next x-men film, x3, delayed.
|
||||
Next X-Men Film, x3, Delayed.
|
||||
Next X-Men Film, X3, Delayed.
|
||||
]]>
|
||||
</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
|
||||
-->
|
||||
@@ -0,0 +1,83 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.modifier.cat">
|
||||
<title>cat</title>
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="5">
|
||||
<colspec colname="param" align="center" />
|
||||
<colspec colname="type" align="center" />
|
||||
<colspec colname="required" align="center" />
|
||||
<colspec colname="cat" align="center" />
|
||||
<colspec colname="desc" />
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Posizione del Parametro</entry>
|
||||
<entry>Tipo</entry>
|
||||
<entry>Obbligatorio</entry>
|
||||
<entry>Default</entry>
|
||||
<entry>Descrizione</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>1</entry>
|
||||
<entry>stringa</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>vuoto</emphasis></entry>
|
||||
<entry>Valore che viene concatenato alla variabile.</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
Questo valore viene concatenato alla variabile data.
|
||||
</para>
|
||||
<example>
|
||||
<title>cat</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('articleTitle', "Psychics predict world didn't end");
|
||||
$smarty->display('index.tpl');
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Dove index.tpl <20>:
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{$articleTitle|cat:" yesterday."}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Questo stamper<65>:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Psychics predict world didn't end yesterday.
|
||||
]]>
|
||||
</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
|
||||
-->
|
||||
@@ -0,0 +1,89 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.modifier.count.characters">
|
||||
<title>count_characters</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>Posizione del Parametro</entry>
|
||||
<entry>Tipo</entry>
|
||||
<entry>Obbligatorio</entry>
|
||||
<entry>Default</entry>
|
||||
<entry>Descrizione</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>1</entry>
|
||||
<entry>booleano</entry>
|
||||
<entry>No</entry>
|
||||
<entry>false</entry>
|
||||
<entry>Stabilisce se gli spazi devono essere inclusi nel conteggio.</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
E' usato per contare il numero di caratteri contenuti in una variabile.
|
||||
</para>
|
||||
<example>
|
||||
<title>count_characters</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('articleTitle', 'Cold Wave Linked to Temperatures.');
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Dove index.tpl <20>:
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{$articleTitle}
|
||||
{$articleTitle|count_characters}
|
||||
{$articleTitle|count_characters:true}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Questo stamper<65>:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Cold Wave Linked to Temperatures.
|
||||
29
|
||||
33
|
||||
]]>
|
||||
</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
|
||||
-->
|
||||
@@ -0,0 +1,61 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.modifier.count.paragraphs">
|
||||
<title>count_paragraphs</title>
|
||||
<para>
|
||||
Si usa per contare il numero di paragrafi contenuti in una variabile.
|
||||
</para>
|
||||
<example>
|
||||
<title>count_paragraphs</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('articleTitle', "War Dims Hope for Peace. Child's Death Ruins
|
||||
Couple's Holiday.\n\nMan is Fatally Slain. Death Causes Loneliness, Feeling of Isolation.");
|
||||
$smarty->display('index.tpl');
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Dove index.tpl <20>:
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{$articleTitle}
|
||||
{$articleTitle|count_paragraphs}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Questo stamper<65>:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
War Dims Hope for Peace. Child's Death Ruins Couple's Holiday.
|
||||
|
||||
Man is Fatally Slain. Death Causes Loneliness, Feeling of Isolation.
|
||||
2
|
||||
]]>
|
||||
</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
|
||||
-->
|
||||
@@ -0,0 +1,60 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.modifier.count.sentences">
|
||||
<title>count_sentences</title>
|
||||
<para>
|
||||
E' usato per contare il numero di frasi contenute in una variabile.
|
||||
</para>
|
||||
<example>
|
||||
<title>count_sentences</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('articleTitle', 'Two Soviet Ships Collide - One Dies. Enraged Cow Injures Farmer with Axe.');
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Dove index.tpl <20>:
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{$articleTitle}
|
||||
{$articleTitle|count_sentences}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Questo stamper<65>:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Two Soviet Ships Collide - One Dies. Enraged Cow Injures Farmer with Axe.
|
||||
2
|
||||
]]>
|
||||
</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
|
||||
-->
|
||||
@@ -0,0 +1,60 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.modifier.count.words">
|
||||
<title>count_words</title>
|
||||
<para>
|
||||
E' usato per contare il numero di parole contenute in una variabile.
|
||||
</para>
|
||||
<example>
|
||||
<title>count_words</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('articleTitle', 'Dealers Will Hear Car Talk at Noon.');
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Dove index.tpl <20>:
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{$articleTitle}
|
||||
{$articleTitle|count_words}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Questo stamper<65>:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Dealers Will Hear Car Talk at Noon.
|
||||
7
|
||||
]]>
|
||||
</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
|
||||
-->
|
||||
@@ -0,0 +1,234 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.modifier.date.format">
|
||||
<title>date_format</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>Posizione del Parametro</entry>
|
||||
<entry>Tipo</entry>
|
||||
<entry>Obbligatorio</entry>
|
||||
<entry>Default</entry>
|
||||
<entry>Descrizione</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>1</entry>
|
||||
<entry>stringa</entry>
|
||||
<entry>No</entry>
|
||||
<entry>%b %e, %Y</entry>
|
||||
<entry>E' il formato per la data in output.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>2</entry>
|
||||
<entry>stringa</entry>
|
||||
<entry>No</entry>
|
||||
<entry>nessuno</entry>
|
||||
<entry>E' la data di default se la variabile in input <20> vuota.</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
Questo modificatore formatta una data e un'ora nel formato dato di
|
||||
strftime(). Le date possono essere passate a Smarty come timestamp Unix,
|
||||
timestamp MySql o una qualsiasi stringa contenente mese giorno anno
|
||||
(riconoscibile da strtotime). I progettisti quindi possono usare
|
||||
date_format per avere il pieno controllo della formattazione della data.
|
||||
Se la data passata a date_format <20> vuota ed <20> presente un secondo parametro,
|
||||
verr<72> usato questo come data da formattare.
|
||||
</para>
|
||||
<example>
|
||||
<title>date_format</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('yesterday', strtotime('-1 day'));
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Dove index.tpl <20>:
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{$smarty.now|date_format}
|
||||
{$smarty.now|date_format:"%A, %B %e, %Y"}
|
||||
{$smarty.now|date_format:"%H:%M:%S"}
|
||||
{$yesterday|date_format}
|
||||
{$yesterday|date_format:"%A, %B %e, %Y"}
|
||||
{$yesterday|date_format:"%H:%M:%S"}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Questo stamper<65>:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Feb 6, 2001
|
||||
Tuesday, February 6, 2001
|
||||
14:33:00
|
||||
Feb 5, 2001
|
||||
Monday, February 5, 2001
|
||||
14:33:00
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
<para>
|
||||
Parametri di conversione di date_format:
|
||||
<itemizedlist>
|
||||
<listitem><para>
|
||||
%a - nome abbreviato del giorno della settimana in base all'impostazione di "locale"
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%A - nome intero del giorno della settimana in base all'impostazione di "locale"
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%b - nome abbreviato del mese in base all'impostazione di "locale"
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%B - nome intero del mese in base all'impostazione di "locale"
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%c - rappresentazione preferita di ora e data in base all'impostazione di "locale"
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%C - numero del secolo (l'anno diviso per 100 e troncato ad intero, range da 00 a 99)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%d - giorno del mese come numero decimale (range da 00 a 31)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%D - corrisponde a %m/%d/%y
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%e - giorno del mese come numero decimale; la cifra singola <20> preceduta da uno spazio (range da 1 a 31)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%g - anno in base alle settimane, su due cifre [00,99]
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%G - anno in base alle settimane, su quattro cifre [0000,9999]
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%h - corrisponde a %b
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%H - ora come numero decimale, su 24 ore (range da 00 a 23)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%I - ora come numero decimale, su 12 ore (range da 01 a 12)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%j - giorno dell'anno come numero decimale (range da 001 a 366)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%k - ora (su 24 ore) con le cifre singole precedute da spazio (range da 0 a 23)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%l - ora (su 12 ore) con le cifre singole precedute da spazio (range da 1 a 12)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%m - mese come numero decimale (range da 01 a 12)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%M - minuto come numero decimale
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%n - carattere di "a capo"
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%p - `am' o `pm' (antimeridiane o postmeridiane) in base all'ora, o valore corrispondente in base all'impostazione di "locale"
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%r - ora completa nella notazione con a.m. e p.m.
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%R - ora completa nella notazione su 24 ore
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%S - secondi come numero decimale
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%t - carattere di tabulazione
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%T - ora corrente, con formato equivalente a %H:%M:%S
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%u - giorno della settimana come numero decimale [1,7], in cui 1 rappresenta Luned<65>
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%U - numero della settimana nell'anno come numero decimale, partendo dalla prima Domenica come primo giorno della prima settimana
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%V - Il numero della settimana ISO 8601:1988 come numero decimale, range da 01 a 53, dove la settimana 1 <20> la prima ad avere almeno 4 giorni nell'anno, e Luned<65> <20> il primo giorno della settimana.
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%w - giorno della settimana come numero decimale, dove la Domenica <20> 0
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%W - numero della settimana nell'anno come numero decimale, partendo dal primo luned<65> come primo giorno della prima settimana
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%x - rappresentazione preferita della data secondo l'impostazione di "locale", senza l'ora
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%X - rappresentazione preferita dell'ora secondo l'impostazione di "locale", senza data
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%y - anno come numero decimale su due cifre (range da 00 a 99)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%Y - anno come numero decimale su quattro cifre
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%Z - time zone o nome o abbreviazione
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%% - il carattere `%'
|
||||
</para></listitem>
|
||||
</itemizedlist>
|
||||
<note>
|
||||
<title>Nota per i programmatori</title>
|
||||
<para>
|
||||
date_format <20> fondamentalmente un involucro per la funzione PHP strftime().
|
||||
Potete avere disponibili pi<70> o meno specificatori di conversione, in base
|
||||
alla funzione strftime() del sistema su cui PHP <20> stato compilato. Controllate
|
||||
le pagine di manuale del vostro sistema per una lista completa degli
|
||||
specificatori validi.
|
||||
</para>
|
||||
</note>
|
||||
</para>
|
||||
</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
|
||||
-->
|
||||
@@ -0,0 +1,89 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.modifier.default">
|
||||
<title>default</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>Posizione del Parametro</entry>
|
||||
<entry>Tipo</entry>
|
||||
<entry>Obbligatorio</entry>
|
||||
<entry>Default</entry>
|
||||
<entry>Descrizione</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>1</entry>
|
||||
<entry>stringa</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>vuoto</emphasis></entry>
|
||||
<entry>E' il valore di default da stampare se la variabile <20> vuota.</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
E' usato per impostare un valore di default per una variabile. Se la
|
||||
variabile <20> vuota o non impostata, il valore di default viene stampato
|
||||
al suo posto. Prende un parametro.
|
||||
</para>
|
||||
<example>
|
||||
<title>default</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('articleTitle', 'Dealers Will Hear Car Talk at Noon.');
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Dove index.tpl <20>:
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{$articleTitle|default:"no title"}
|
||||
{$myTitle|default:"no title"}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Questo stamper<65>:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Dealers Will Hear Car Talk at Noon.
|
||||
no title
|
||||
]]>
|
||||
</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
|
||||
-->
|
||||
@@ -0,0 +1,102 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.modifier.escape">
|
||||
<title>escape</title>
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="6">
|
||||
<colspec colname="param" align="center" />
|
||||
<colspec colname="type" align="center" />
|
||||
<colspec colname="required" align="center" />
|
||||
<colspec colname="possible" align="center" />
|
||||
<colspec colname="default" align="center" />
|
||||
<colspec colname="desc" />
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Posizione del Parametro</entry>
|
||||
<entry>Tipo</entry>
|
||||
<entry>Obbligatorio</entry>
|
||||
<entry>Valori possibili</entry>
|
||||
<entry>Default</entry>
|
||||
<entry>Descrizione</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>1</entry>
|
||||
<entry>stringa</entry>
|
||||
<entry>No</entry>
|
||||
<entry>html,htmlall,url,quotes,hex,hexentity,javascript</entry>
|
||||
<entry>html</entry>
|
||||
<entry>E' il tipo di escape da utilizzare.</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
E' usato per fare un escape di tipo html, url, su apici per una variabile
|
||||
su cui non sia gi<67> stato fatto l'escape, hex (esadecimale), hexentity o
|
||||
javascript.
|
||||
Per default viene applicato un escape di tipo html.
|
||||
</para>
|
||||
<example>
|
||||
<title>escape</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('articleTitle', "'Stiff Opposition Expected to Casketless Funeral Plan'");
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Dove index.tpl <20>:
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{$articleTitle}
|
||||
{$articleTitle|escape}
|
||||
{$articleTitle|escape:"html"} {* escapes & " ' < > *}
|
||||
{$articleTitle|escape:"htmlall"} {* escapes ALL html entities *}
|
||||
{$articleTitle|escape:"url"}
|
||||
{$articleTitle|escape:"quotes"}
|
||||
<a href="mailto:{$EmailAddress|escape:"hex"}">{$EmailAddress|escape:"hexentity"}</a>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>Questo stamper<65>:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
'Stiff Opposition Expected to Casketless Funeral Plan'
|
||||
'Stiff Opposition Expected to Casketless Funeral Plan'
|
||||
'Stiff Opposition Expected to Casketless Funeral Plan'
|
||||
'Stiff Opposition Expected to Casketless Funeral Plan'
|
||||
%27Stiff+Opposition+Expected+to+Casketless+Funeral+Plan%27
|
||||
\'Stiff Opposition Expected to Casketless Funeral Plan\'
|
||||
<a href="mailto:%62%6f%62%40%6d%65%2e%6e%65%74">bob@me.net</a>
|
||||
]]>
|
||||
</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
|
||||
-->
|
||||
@@ -0,0 +1,118 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.modifier.indent">
|
||||
<title>indent</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>Posizione del Parametro</entry>
|
||||
<entry>Tipo</entry>
|
||||
<entry>Obbligatorio</entry>
|
||||
<entry>Default</entry>
|
||||
<entry>Descrizione</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>1</entry>
|
||||
<entry>intero</entry>
|
||||
<entry>No</entry>
|
||||
<entry>4</entry>
|
||||
<entry>Stabilisce di quanti caratteri deve essere l'indentazione.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>2</entry>
|
||||
<entry>stringa</entry>
|
||||
<entry>No</entry>
|
||||
<entry>(uno spazio)</entry>
|
||||
<entry>Questo <20> il carattere usato per l'indentazione.</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
Questo modificatore effettua un'indentazione della stringa ad ogni riga, per
|
||||
default di 4 caratteri. Come parametro opzionale si pu<70> specificare di quanti
|
||||
caratteri deve essere l'indentazione. Si pu<70> indicare anche, come secondo
|
||||
parametro opzionale, quale carattere usare per l'indentazione (usare "\t"
|
||||
per il tabulatore).
|
||||
</para>
|
||||
<example>
|
||||
<title>indent</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('articleTitle', 'NJ judge to rule on nude beach.
|
||||
Sun or rain expected today, dark tonight.
|
||||
Statistics show that teen pregnancy drops off significantly after 25.');
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Dove index.tpl <20>:
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{$articleTitle}
|
||||
|
||||
{$articleTitle|indent}
|
||||
|
||||
{$articleTitle|indent:10}
|
||||
|
||||
{$articleTitle|indent:1:"\t"}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Questo stamper<65>:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
NJ judge to rule on nude beach.
|
||||
Sun or rain expected today, dark tonight.
|
||||
Statistics show that teen pregnancy drops off significantly after 25.
|
||||
|
||||
NJ judge to rule on nude beach.
|
||||
Sun or rain expected today, dark tonight.
|
||||
Statistics show that teen pregnancy drops off significantly after 25.
|
||||
|
||||
NJ judge to rule on nude beach.
|
||||
Sun or rain expected today, dark tonight.
|
||||
Statistics show that teen pregnancy drops off significantly after 25.
|
||||
|
||||
NJ judge to rule on nude beach.
|
||||
Sun or rain expected today, dark tonight.
|
||||
Statistics show that teen pregnancy drops off significantly after 25.
|
||||
]]>
|
||||
</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
|
||||
-->
|
||||
@@ -0,0 +1,60 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.modifier.lower">
|
||||
<title>lower</title>
|
||||
<para>
|
||||
Si usa per trasformare una variabile in lettere minuscole.
|
||||
</para>
|
||||
<example>
|
||||
<title>lower</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('articleTitle', 'Two Convicts Evade Noose, Jury Hung.');
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Dove index.tpl <20>:
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{$articleTitle}
|
||||
{$articleTitle|lower}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Questo stamper<65>:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Two Convicts Evade Noose, Jury Hung.
|
||||
two convicts evade noose, jury hung.
|
||||
]]>
|
||||
</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
|
||||
-->
|
||||
@@ -0,0 +1,60 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.modifier.nl2br">
|
||||
<title>nl2br</title>
|
||||
<para>
|
||||
Tutti i caratteri di interruzione di linea verranno convertiti in tag
|
||||
<br /> nella variabile data. E' equivalente alla funzione PHP
|
||||
nl2br().
|
||||
</para>
|
||||
<example>
|
||||
<title>nl2br</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('articleTitle', "Sun or rain expected\ntoday, dark tonight");
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Dove index.tpl <20>:
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{$articleTitle|nl2br}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Questo stamper<65>:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Sun or rain expected<br />today, dark tonight
|
||||
]]>
|
||||
</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
|
||||
-->
|
||||
@@ -0,0 +1,98 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.modifier.regex.replace">
|
||||
<title>regex_replace</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>Posizione del Parametro</entry>
|
||||
<entry>Tipo</entry>
|
||||
<entry>Obbligatorio</entry>
|
||||
<entry>Default</entry>
|
||||
<entry>Descrizione</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>1</entry>
|
||||
<entry>stringa</entry>
|
||||
<entry>S<EFBFBD></entry>
|
||||
<entry><emphasis>nessuno</emphasis></entry>
|
||||
<entry>E' l'espressione regolare da sostituire.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>2</entry>
|
||||
<entry>stringa</entry>
|
||||
<entry>S<EFBFBD></entry>
|
||||
<entry><emphasis>nessuno</emphasis></entry>
|
||||
<entry>E' la stringa di testo da usare per la sostituzione.</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
Un 'trova e sostituisci' di una espressione regolare su una variabile.
|
||||
Usare la sintassi per preg_replace() dal manuale PHP.
|
||||
</para>
|
||||
<example>
|
||||
<title>regex_replace</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('articleTitle', "Infertility unlikely to\nbe passed on, experts say.");
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Dove index.tpl <20>:
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{* sostituisce i carriage return, i tab e gli a capo con uno spazio *}
|
||||
|
||||
{$articleTitle}
|
||||
{$articleTitle|regex_replace:"/[\r\t\n]/":" "}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Questo stamper<65>:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Infertility unlikely to
|
||||
be passed on, experts say.
|
||||
Infertility unlikely to be passed on, experts say.
|
||||
]]>
|
||||
</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
|
||||
-->
|
||||
@@ -0,0 +1,96 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.modifier.replace">
|
||||
<title>replace</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>Posizione del Parametro</entry>
|
||||
<entry>Tipo</entry>
|
||||
<entry>Obbligatorio</entry>
|
||||
<entry>Default</entry>
|
||||
<entry>Descrizione</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>1</entry>
|
||||
<entry>stringa</entry>
|
||||
<entry>S<EFBFBD></entry>
|
||||
<entry><emphasis>nessuno</emphasis></entry>
|
||||
<entry>E' la stringa di testo da sostituire.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>2</entry>
|
||||
<entry>stringa</entry>
|
||||
<entry>S<EFBFBD></entry>
|
||||
<entry><emphasis>nessuno</emphasis></entry>
|
||||
<entry>E' la stringa di testo da usare per la sostituzione.</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
Una semplice ricerca e sostituzione su una variabile.
|
||||
</para>
|
||||
<example>
|
||||
<title>replace</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('articleTitle', "Child's Stool Great for Use in Garden.");
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Dove index.tpl <20>:
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{$articleTitle}
|
||||
{$articleTitle|replace:"Garden":"Vineyard"}
|
||||
{$articleTitle|replace:" ":" "}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Questo stamper<65>:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Child's Stool Great for Use in Garden.
|
||||
Child's Stool Great for Use in Vineyard.
|
||||
Child's Stool Great for Use in Garden.
|
||||
]]>
|
||||
</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
|
||||
-->
|
||||
@@ -0,0 +1,88 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.modifier.spacify">
|
||||
<title>spacify</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>Posizione del Parametro</entry>
|
||||
<entry>Tipo</entry>
|
||||
<entry>Obbligatorio</entry>
|
||||
<entry>Default</entry>
|
||||
<entry>Descrizione</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>1</entry>
|
||||
<entry>stringa</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>uno spazio</emphasis></entry>
|
||||
<entry>E' ci<63> che viene inserito fra i caratteri della variabile.</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
spacify <20> un modo per inserire uno spazio fra tutti i caratteri di una variabile.
|
||||
E' possibile, opzionalmente, passare un diverso carattere (o stringa) da inserire.
|
||||
</para>
|
||||
<example>
|
||||
<title>spacify</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('articleTitle', 'Something Went Wrong in Jet Crash, Experts Say.');
|
||||
$smarty->display('index.tpl');
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Dove index.tpl <20>:
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{$articleTitle}
|
||||
{$articleTitle|spacify}
|
||||
{$articleTitle|spacify:"^^"}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Questo stamper<65>:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Something Went Wrong in Jet Crash, Experts Say.
|
||||
S o m e t h i n g W e n t W r o n g i n J e t C r a s h , E x p e r t s S a y .
|
||||
S^^o^^m^^e^^t^^h^^i^^n^^g^^ ^^W^^e^^n^^t^^ ^^W^^r^^o^^n^^g^^ ^^i^^n^^ ^^J^^e^^t^^ ^^C^^r^^a^^s^^h^^,^^ ^^E^^x^^p^^e^^r^^t^^s^^ ^^S^^a^^y^^.
|
||||
]]>
|
||||
</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
|
||||
-->
|
||||
@@ -0,0 +1,90 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.modifier.string.format">
|
||||
<title>string_format</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>Posizione del Parametro</entry>
|
||||
<entry>Tipo</entry>
|
||||
<entry>Obbligatorio</entry>
|
||||
<entry>Default</entry>
|
||||
<entry>Descrizione</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>1</entry>
|
||||
<entry>stringa</entry>
|
||||
<entry>S<EFBFBD></entry>
|
||||
<entry><emphasis>nessuno</emphasis></entry>
|
||||
<entry>E' il formato da usare. (sprintf)</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
Questo <20> un modo di formattare stringhe, ad esempio per i numeri
|
||||
decimali e altro. Utilizzare la sintassi della funzione PHP sprintf().
|
||||
</para>
|
||||
<example>
|
||||
<title>string_format</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('number', 23.5787446);
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Dove index.tpl <20>:
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{$number}
|
||||
{$number|string_format:"%.2f"}
|
||||
{$number|string_format:"%d"}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Questo stamper<65>:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
23.5787446
|
||||
23.58
|
||||
24
|
||||
]]>
|
||||
</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
|
||||
-->
|
||||
@@ -0,0 +1,91 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.modifier.strip.tags">
|
||||
<title>strip_tags</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>Posizione del Parametro</entry>
|
||||
<entry>Tipo</entry>
|
||||
<entry>Obbligatorio</entry>
|
||||
<entry>Default</entry>
|
||||
<entry>Descrizione</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>1</entry>
|
||||
<entry>booleano</entry>
|
||||
<entry>No</entry>
|
||||
<entry>true</entry>
|
||||
<entry>Stabilisce se i tag saranno sostituiti con ' ' (true) o con '' (false)</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
Questo elimina i tag di markup, cio<69> fondamentalmente qualsiasi cosa compresa
|
||||
fra < and >.
|
||||
</para>
|
||||
<example>
|
||||
<title>strip_tags</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('articleTitle', "Blind Woman Gets <font face=\"helvetica\">New
|
||||
Kidney</font> from Dad she Hasn't Seen in <b>years</b>.");
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Dove index.tpl <20>:
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{$articleTitle}
|
||||
{$articleTitle|strip_tags} {* equivale a {$articleTitle|strip_tags:true} *}
|
||||
{$articleTitle|strip_tags:false}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Questo stamper<65>:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Blind Woman Gets <font face="helvetica">New Kidney</font> from Dad she Hasn't Seen in <b>years</b>.
|
||||
Blind Woman Gets New Kidney from Dad she Hasn't Seen in years .
|
||||
Blind Woman Gets New Kidney from Dad she Hasn't Seen in years.
|
||||
]]>
|
||||
</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
|
||||
-->
|
||||
@@ -0,0 +1,71 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.modifier.strip">
|
||||
<title>strip</title>
|
||||
<para>
|
||||
Sostituisce tutte le sequenze di spazi, a capo e tabulatori con
|
||||
un singolo spazio o con la stringa fornita.
|
||||
</para>
|
||||
<note>
|
||||
<title>Nota</title>
|
||||
<para>
|
||||
Se volete fare lo strip su blocchi di testo del template, usate
|
||||
la <link linkend="language.function.strip">funzione strip</link>.
|
||||
</para>
|
||||
</note>
|
||||
<example>
|
||||
<title>strip</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('articleTitle', "Grandmother of\neight makes\t hole in one.");
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Dove index.tpl <20>:
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{$articleTitle}
|
||||
{$articleTitle|strip}
|
||||
{$articleTitle|strip:" "}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Questo stamper<65>:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Grandmother of
|
||||
eight makes hole in one.
|
||||
Grandmother of eight makes hole in one.
|
||||
Grandmother of eight makes hole in one.
|
||||
]]>
|
||||
</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
|
||||
-->
|
||||
@@ -0,0 +1,118 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.modifier.truncate">
|
||||
<title>truncate</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>Posizione del Parametro</entry>
|
||||
<entry>Tipo</entry>
|
||||
<entry>Obbligatorio</entry>
|
||||
<entry>Default</entry>
|
||||
<entry>Descrizione</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>1</entry>
|
||||
<entry>intero</entry>
|
||||
<entry>No</entry>
|
||||
<entry>80</entry>
|
||||
<entry>Stabilisce a quanti caratteri effettuare il troncamento.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>2</entry>
|
||||
<entry>stringa</entry>
|
||||
<entry>No</entry>
|
||||
<entry>...</entry>
|
||||
<entry>Testo da aggiungere in fondo quando c'<27> troncamento.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>3</entry>
|
||||
<entry>booleano</entry>
|
||||
<entry>No</entry>
|
||||
<entry>false</entry>
|
||||
<entry>Stabilisce se troncare dopo una parola (false), o al carattere
|
||||
esatto (true).</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
Effettua il troncamento di una variabile ad un certo numero di caratteri,
|
||||
per default 80. Come secondo parametro opzionale potete specificare una
|
||||
stringa di testo da mostrare alla fine se la variabile <20> stata troncata.
|
||||
Questi caratteri non vengono conteggiati nella lunghezza della
|
||||
stringa troncata. Per default, truncate cercher<65> di tagliare la stringa al
|
||||
termine di una parola. Se invece volete effettuare il troncamento alla
|
||||
lunghezza esatta in caratteri, passate il terzo parametro opzionale come true.
|
||||
</para>
|
||||
<example>
|
||||
<title>truncate</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('articleTitle', 'Two Sisters Reunite after Eighteen Years at Checkout Counter.');
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Dove index.tpl <20>:
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{$articleTitle}
|
||||
{$articleTitle|truncate}
|
||||
{$articleTitle|truncate:30}
|
||||
{$articleTitle|truncate:30:""}
|
||||
{$articleTitle|truncate:30:"---"}
|
||||
{$articleTitle|truncate:30:"":true}
|
||||
{$articleTitle|truncate:30:"...":true}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Questo stamper<65>:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Two Sisters Reunite after Eighteen Years at Checkout Counter.
|
||||
Two Sisters Reunite after Eighteen Years at Checkout Counter.
|
||||
Two Sisters Reunite after...
|
||||
Two Sisters Reunite after
|
||||
Two Sisters Reunite after---
|
||||
Two Sisters Reunite after Eigh
|
||||
Two Sisters Reunite after E...
|
||||
]]>
|
||||
</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
|
||||
-->
|
||||
@@ -0,0 +1,60 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.modifier.upper">
|
||||
<title>upper</title>
|
||||
<para>
|
||||
Si usa per trasformare una variabile in maiuscolo.
|
||||
</para>
|
||||
<example>
|
||||
<title>upper</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('articleTitle', "If Strike isn't Settled Quickly it may Last a While.");
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Dove index.tpl <20>:
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{$articleTitle}
|
||||
{$articleTitle|upper}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Questo stamper<65>:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
If Strike isn't Settled Quickly it may Last a While.
|
||||
IF STRIKE ISN'T SETTLED QUICKLY IT MAY LAST A WHILE.
|
||||
]]>
|
||||
</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
|
||||
-->
|
||||
@@ -0,0 +1,130 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.modifier.wordwrap">
|
||||
<title>wordwrap</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>Posizione del Parametro</entry>
|
||||
<entry>Tipo</entry>
|
||||
<entry>Obbligatorio</entry>
|
||||
<entry>Default</entry>
|
||||
<entry>Descrizione</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>1</entry>
|
||||
<entry>intero</entry>
|
||||
<entry>No</entry>
|
||||
<entry>80</entry>
|
||||
<entry>Stabilisce la larghezza della colonna.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>2</entry>
|
||||
<entry>stringa</entry>
|
||||
<entry>No</entry>
|
||||
<entry>\n</entry>
|
||||
<entry>Questa <20> la stringa usata per andare a capo.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>3</entry>
|
||||
<entry>booleano</entry>
|
||||
<entry>No</entry>
|
||||
<entry>false</entry>
|
||||
<entry>Stabilisce se andare a capo dopo una parola intera (false),
|
||||
o al carattere esatto (true).</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
Dispone una stringa su pi<70> righe usando come riferimento una certa
|
||||
larghezza di colonna, per default 80. Come secondo parametro opzionale
|
||||
potete specificare una stringa da usare per separare le righe (il
|
||||
default <20> \n). Per default, wordwrap cercher<65> di andare a capo dopo
|
||||
una parola intera. Se volete che vada a capo all'esatta larghezza in
|
||||
caratteri, passate il terzo parametro opzionale come true.
|
||||
</para>
|
||||
<example>
|
||||
<title>wordwrap</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('articleTitle', "Blind woman gets new kidney from dad she hasn't seen in years.");
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Dove index.tpl <20>:
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{$articleTitle}
|
||||
|
||||
{$articleTitle|wordwrap:30}
|
||||
|
||||
{$articleTitle|wordwrap:20}
|
||||
|
||||
{$articleTitle|wordwrap:30:"<br />\n"}
|
||||
|
||||
{$articleTitle|wordwrap:30:"\n":true}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Questo stamper<65>:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Blind woman gets new kidney from dad she hasn't seen in years.
|
||||
|
||||
Blind woman gets new kidney
|
||||
from dad she hasn't seen in
|
||||
years.
|
||||
|
||||
Blind woman gets new
|
||||
kidney from dad she
|
||||
hasn't seen in
|
||||
years.
|
||||
|
||||
Blind woman gets new kidney<br />
|
||||
from dad she hasn't seen in<br />
|
||||
years.
|
||||
|
||||
Blind woman gets new kidney
|
||||
from dad she hasn't seen in
|
||||
years.
|
||||
]]>
|
||||
</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
|
||||
-->
|
||||
Reference in New Issue
Block a user