mirror of
				https://github.com/smarty-php/smarty.git
				synced 2025-10-31 04:11:37 +01:00 
			
		
		
		
	
		
			
	
	
		
			161 lines
		
	
	
		
			5.8 KiB
		
	
	
	
		
			XML
		
	
	
	
	
	
		
		
			
		
	
	
			161 lines
		
	
	
		
			5.8 KiB
		
	
	
	
		
			XML
		
	
	
	
	
	
|   | <?xml version="1.0" encoding="iso-8859-1"?> | |||
|  | <!-- $Revision$ --> | |||
|  | 		<sect1 id="language.function.html.image"> | |||
|  | 			<title>html_image</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>file</entry> | |||
|  |                         <entry>stringa</entry> | |||
|  |                         <entry>s<EFBFBD></entry> | |||
|  |                         <entry><emphasis>nessuno</emphasis></entry> | |||
|  |                         <entry>nome/percorso dell'immagine</entry> | |||
|  |                     </row> | |||
|  |                     <row> | |||
|  |                         <entry>border</entry> | |||
|  |                         <entry>stringa</entry> | |||
|  |                         <entry>no</entry> | |||
|  |                         <entry><emphasis>0</emphasis></entry> | |||
|  |                         <entry>dimensione del bordo dell'immagine</entry> | |||
|  |                     </row> | |||
|  |                     <row> | |||
|  |                         <entry>height</entry> | |||
|  |                         <entry>stringa</entry> | |||
|  |                         <entry>no</entry> | |||
|  |                         <entry><emphasis>altezza effettiva dell'immagine</emphasis></entry> | |||
|  |                         <entry>altezza con cui visualizzare l'immagine</entry> | |||
|  |                     </row> | |||
|  |                     <row> | |||
|  |                         <entry>width</entry> | |||
|  |                         <entry>stringa</entry> | |||
|  |                         <entry>no</entry> | |||
|  |                         <entry><emphasis>larghezza effettiva dell'immagine</emphasis></entry> | |||
|  |                         <entry>larghezza con cui visualizzare l'immagine</entry> | |||
|  |                     </row> | |||
|  |                     <row> | |||
|  |                         <entry>basedir</entry> | |||
|  |                         <entry>stringa</entry> | |||
|  |                         <entry>no</entry> | |||
|  |                         <entry><emphasis>doc root del web server</emphasis></entry> | |||
|  |                         <entry>directory di base per percorsi relativi</entry> | |||
|  |                     </row> | |||
|  |                     <row> | |||
|  |                         <entry>alt</entry> | |||
|  |                         <entry>stringa</entry> | |||
|  |                         <entry>no</entry> | |||
|  |                         <entry><emphasis>""</emphasis></entry> | |||
|  |                         <entry>descrizione alternativa dell'immagine</entry> | |||
|  |                     </row> | |||
|  |                     <row> | |||
|  |                         <entry>href</entry> | |||
|  |                         <entry>stringa</entry> | |||
|  |                         <entry>no</entry> | |||
|  |                         <entry><emphasis>nessuno</emphasis></entry> | |||
|  |                         <entry>valore di href per il link dell'immagine</entry> | |||
|  |                     </row> | |||
|  |                 </tbody> | |||
|  |                 </tgroup> | |||
|  |             </informaltable> | |||
|  | 			<para> | |||
|  | 			html_image <20> una funzione utente che genera un tag HTML per una | |||
|  |                         immagine. L'altezza e la larghezza, quando non indicate, vengono  | |||
|  |                         calcolate automaticamente dal file dell'immagine. | |||
|  | 			</para> | |||
|  | 			<para> | |||
|  | 			basedir <20> la directory di riferimento per percorsi relativi. Se non | |||
|  | 			viene indicata, viene usata come base la document root del web | |||
|  | 			server (variabile di ambiente DOCUMENT_ROOT). Se la security <20> | |||
|  | 			abilitata, il percorso dell'immagine deve trovarsi in una directory | |||
|  | 			considerata sicura. | |||
|  | 			</para> | |||
|  | 			<para> | |||
|  | 			<parameter>href</parameter> <20> l'indirizzo del link a cui collegare | |||
|  |                         l'immagine. Se viene fornito, verr<72> creato un tag | |||
|  | 			<a href="LINKVALUE"><a> attorno al tag image. | |||
|  | 			</para> | |||
|  | 			<para> | |||
|  | 			Tutti i parametri non compresi nella lista qui sopra vengono | |||
|  | 			stampati come coppie nome/valore all'interno del tag <img> | |||
|  | 			generato. | |||
|  | 			</para> | |||
|  | 			<note> | |||
|  | 				<title>Nota tecnica</title> | |||
|  | 				<para> | |||
|  | 				html_image richiede un accesso al disco per leggere il | |||
|  | 				file dell'immagine e calcolarne altezza e larghezza. Se non | |||
|  | 				usate il caching dei template, <20> generalmente consigliabile | |||
|  | 				evitare html_image e lasciare i tag image statici per | |||
|  | 				ottenere prestazioni ottimali. | |||
|  |             	</para> | |||
|  | 			</note> | |||
|  |    <example> | |||
|  |     <title>esempio di html_image</title> | |||
|  |     <programlisting role="php"> | |||
|  | <![CDATA[ | |||
|  | <?php | |||
|  | 
 | |||
|  | require('Smarty.class.php'); | |||
|  | $smarty = new Smarty; | |||
|  | $smarty->display('index.tpl'); | |||
|  | 
 | |||
|  | ?> | |||
|  | ]]> | |||
|  |     </programlisting> | |||
|  |     <para> | |||
|  |      dove index.tpl <20>: | |||
|  |     </para> | |||
|  |     <programlisting> | |||
|  | <![CDATA[ | |||
|  | {html_image file="pumpkin.jpg"} | |||
|  | {html_image file="/path/from/docroot/pumpkin.jpg"} | |||
|  | {html_image file="../path/relative/to/currdir/pumpkin.jpg"} | |||
|  | ]]> | |||
|  |     </programlisting> | |||
|  |     <para> | |||
|  |      un possibile output potrebbe essere: | |||
|  |     </para> | |||
|  |     <screen> | |||
|  | <![CDATA[ | |||
|  | <img src="pumpkin.jpg" alt="" border="0" width="44" height="68" /> | |||
|  | <img src="/path/from/docroot/pumpkin.jpg" alt="" border="0" width="44" height="68" /> | |||
|  | <img src="../path/relative/to/currdir/pumpkin.jpg" alt="" border="0" width="44" height="68" /> | |||
|  | ]]> | |||
|  |     </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 | |||
|  | --> |