mirror of
				https://github.com/smarty-php/smarty.git
				synced 2025-10-31 12:21:36 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			255 lines
		
	
	
		
			6.9 KiB
		
	
	
	
		
			XML
		
	
	
	
	
	
			
		
		
	
	
			255 lines
		
	
	
		
			6.9 KiB
		
	
	
	
		
			XML
		
	
	
	
	
	
| <?xml version="1.0" encoding="iso-8859-1"?>
 | ||
| <!-- $Revision$ -->
 | ||
| 		<sect1 id="language.function.textformat">
 | ||
| 			<title>textformat</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>style</entry>
 | ||
|                         <entry>stringa</entry>
 | ||
|                         <entry>no</entry>
 | ||
|                         <entry><emphasis>nessuno</emphasis></entry>
 | ||
|                         <entry>stile predefinito</entry>
 | ||
|                     </row>
 | ||
|                     <row>
 | ||
|                         <entry>indent</entry>
 | ||
|                         <entry>numero</entry>
 | ||
|                         <entry>no</entry>
 | ||
|                         <entry><emphasis>0</emphasis></entry>
 | ||
|                         <entry>numero di caratteri da rientrare ad ogni riga</entry>
 | ||
|                     </row>
 | ||
|                     <row>
 | ||
|                         <entry>indent_first</entry>
 | ||
|                         <entry>numero</entry>
 | ||
|                         <entry>no</entry>
 | ||
|                         <entry><emphasis>0</emphasis></entry>
 | ||
|                         <entry>numero di caratteri da rientrare alla prima riga</entry>
 | ||
|                     </row>
 | ||
|                     <row>
 | ||
|                         <entry>indent_char</entry>
 | ||
|                         <entry>stringa</entry>
 | ||
|                         <entry>no</entry>
 | ||
|                         <entry><emphasis>(spazio singolo)</emphasis></entry>
 | ||
|                         <entry>carattere (o stringa di caratteri) da usare come rientro</entry>
 | ||
|                     </row>
 | ||
|                     <row>
 | ||
|                         <entry>wrap</entry>
 | ||
|                         <entry>numero</entry>
 | ||
|                         <entry>no</entry>
 | ||
|                         <entry><emphasis>80</emphasis></entry>
 | ||
|                         <entry>a quanti caratteri spezzare ogni riga</entry>
 | ||
|                     </row>
 | ||
|                     <row>
 | ||
|                         <entry>wrap_char</entry>
 | ||
|                         <entry>stringa</entry>
 | ||
|                         <entry>no</entry>
 | ||
|                         <entry><emphasis>\n</emphasis></entry>
 | ||
|                         <entry>caratteri (o stringa di caratteri) da usare per
 | ||
|                                          spezzare le righe</entry>
 | ||
|                     </row>
 | ||
|                     <row>
 | ||
|                         <entry>wrap_cut</entry>
 | ||
|                         <entry>booleano</entry>
 | ||
|                         <entry>no</entry>
 | ||
|                         <entry><emphasis>false</emphasis></entry>
 | ||
|                         <entry>se vero, le righe verranno spezzate al carattere esatto
 | ||
|                                   invece che al termine di una parola</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>
 | ||
| 			textformat <20> una funzione di blocco usata per formattare il testo.
 | ||
| 			Fondamentalmente rimuove spazi e caratteri speciali, e formatta
 | ||
| 			i paragrafi spezzando le righe ad una certa lunghezza ed inserendo
 | ||
| 			dei rientri.
 | ||
| 			</para>
 | ||
| 			<para>
 | ||
| 			Potete impostare i parametri esplicitamente oppure usare uno
 | ||
| 			stile predefinito. Attualmente "email" <20> l'unico stile disponibile.
 | ||
| 			</para>
 | ||
| <example>
 | ||
| <title>textformat</title>
 | ||
| <programlisting>
 | ||
| {textformat wrap=40}
 | ||
| 
 | ||
| This is foo.
 | ||
| This is foo.
 | ||
| This is foo.
 | ||
| This is foo.
 | ||
| This is foo.
 | ||
| This is foo.
 | ||
| 
 | ||
| This is bar.
 | ||
| 
 | ||
| bar foo bar foo     foo.
 | ||
| bar foo bar foo     foo.
 | ||
| bar foo bar foo     foo.
 | ||
| bar foo bar foo     foo.
 | ||
| bar foo bar foo     foo.
 | ||
| bar foo bar foo     foo.
 | ||
| bar foo bar foo     foo.
 | ||
| 
 | ||
| {/textformat}
 | ||
| 
 | ||
| OUTPUT:
 | ||
| 
 | ||
| This is foo. This is foo. This is foo.
 | ||
| This is foo. This is foo. This is foo.
 | ||
| 
 | ||
| This is bar.
 | ||
| 
 | ||
| bar foo bar foo foo. bar foo bar foo
 | ||
| foo. bar foo bar foo foo. bar foo bar
 | ||
| foo foo. bar foo bar foo foo. bar foo
 | ||
| bar foo foo. bar foo bar foo foo.
 | ||
| 
 | ||
| 
 | ||
| {textformat wrap=40 indent=4}
 | ||
| 
 | ||
| This is foo.
 | ||
| This is foo.
 | ||
| This is foo.
 | ||
| This is foo.
 | ||
| This is foo.
 | ||
| This is foo.
 | ||
| 
 | ||
| This is bar.
 | ||
| 
 | ||
| bar foo bar foo     foo.
 | ||
| bar foo bar foo     foo.
 | ||
| bar foo bar foo     foo.
 | ||
| bar foo bar foo     foo.
 | ||
| bar foo bar foo     foo.
 | ||
| bar foo bar foo     foo.
 | ||
| bar foo bar foo     foo.
 | ||
| 
 | ||
| {/textformat}
 | ||
| 
 | ||
| OUTPUT:
 | ||
| 
 | ||
|     This is foo. This is foo. This is
 | ||
|     foo. This is foo. This is foo. This
 | ||
|     is foo.
 | ||
| 
 | ||
|     This is bar.
 | ||
| 
 | ||
|     bar foo bar foo foo. bar foo bar foo
 | ||
|     foo. bar foo bar foo foo. bar foo
 | ||
|     bar foo foo. bar foo bar foo foo.
 | ||
|     bar foo bar foo foo. bar foo bar
 | ||
|     foo foo.
 | ||
| 
 | ||
| {textformat wrap=40 indent=4 indent_first=4}
 | ||
| 
 | ||
| This is foo.
 | ||
| This is foo.
 | ||
| This is foo.
 | ||
| This is foo.
 | ||
| This is foo.
 | ||
| This is foo.
 | ||
| 
 | ||
| This is bar.
 | ||
| 
 | ||
| bar foo bar foo     foo.
 | ||
| bar foo bar foo     foo.
 | ||
| bar foo bar foo     foo.
 | ||
| bar foo bar foo     foo.
 | ||
| bar foo bar foo     foo.
 | ||
| bar foo bar foo     foo.
 | ||
| bar foo bar foo     foo.
 | ||
| 
 | ||
| {/textformat}
 | ||
| 
 | ||
| OUTPUT:
 | ||
| 
 | ||
|         This is foo. This is foo. This
 | ||
|     is foo. This is foo. This is foo.
 | ||
|     This is foo.
 | ||
| 
 | ||
|         This is bar.
 | ||
| 
 | ||
|         bar foo bar foo foo. bar foo bar
 | ||
|     foo foo. bar foo bar foo foo. bar
 | ||
|     foo bar foo foo. bar foo bar foo
 | ||
|     foo. bar foo bar foo foo. bar foo
 | ||
|     bar foo foo.
 | ||
| 
 | ||
| {textformat style="email"}
 | ||
| 
 | ||
| This is foo.
 | ||
| This is foo.
 | ||
| This is foo.
 | ||
| This is foo.
 | ||
| This is foo.
 | ||
| This is foo.
 | ||
| 
 | ||
| This is bar.
 | ||
| 
 | ||
| bar foo bar foo     foo.
 | ||
| bar foo bar foo     foo.
 | ||
| bar foo bar foo     foo.
 | ||
| bar foo bar foo     foo.
 | ||
| bar foo bar foo     foo.
 | ||
| bar foo bar foo     foo.
 | ||
| bar foo bar foo     foo.
 | ||
| 
 | ||
| {/textformat}
 | ||
| 
 | ||
| OUTPUT:
 | ||
| 
 | ||
| This is foo. This is foo. This is foo. This is foo. This is foo. This is
 | ||
| foo.
 | ||
| 
 | ||
| This is bar.
 | ||
| 
 | ||
| bar foo bar foo foo. bar foo bar foo foo. bar foo bar foo foo. bar foo
 | ||
| bar foo foo. bar foo bar foo foo. bar foo bar foo foo. bar foo bar foo
 | ||
| foo.
 | ||
| 
 | ||
| </programlisting>
 | ||
| </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
 | ||
| -->
 |