mirror of
https://github.com/smarty-php/smarty.git
synced 2025-11-04 14:21:36 +01:00
140 lines
5.5 KiB
XML
140 lines
5.5 KiB
XML
|
|
<?xml version="1.0" encoding="iso-8859-1"?>
|
||
|
|
<!-- $Revision$ -->
|
||
|
|
<sect1 id="language.function.html.image">
|
||
|
|
<title>html_image (Ausgabe von HTML-IMG Tag)</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>Attribut Name</entry>
|
||
|
|
<entry>Typ</entry>
|
||
|
|
<entry>Erforderlich</entry>
|
||
|
|
<entry>Standardwert</entry>
|
||
|
|
<entry>Beschreibung</entry>
|
||
|
|
</row>
|
||
|
|
</thead>
|
||
|
|
<tbody>
|
||
|
|
<row>
|
||
|
|
<entry>file</entry>
|
||
|
|
<entry>string</entry>
|
||
|
|
<entry>Ja</entry>
|
||
|
|
<entry><emphasis>n/a</emphasis></entry>
|
||
|
|
<entry>Name/Pfad zum Bild</entry>
|
||
|
|
</row>
|
||
|
|
<row>
|
||
|
|
<entry>border</entry>
|
||
|
|
<entry>string</entry>
|
||
|
|
<entry>Nein</entry>
|
||
|
|
<entry><emphasis>0</emphasis></entry>
|
||
|
|
<entry>Stärke des Rahmens</entry>
|
||
|
|
</row>
|
||
|
|
<row>
|
||
|
|
<entry>height</entry>
|
||
|
|
<entry>string</entry>
|
||
|
|
<entry>No</entry>
|
||
|
|
<entry><emphasis>Normale Höhe des Bildes</emphasis></entry>
|
||
|
|
<entry>Höhe des Bildes</entry>
|
||
|
|
</row>
|
||
|
|
<row>
|
||
|
|
<entry>width</entry>
|
||
|
|
<entry>string</entry>
|
||
|
|
<entry>No</entry>
|
||
|
|
<entry><emphasis>Normale Breite des Bildes</emphasis></entry>
|
||
|
|
<entry>Breite des Bildes</entry>
|
||
|
|
</row>
|
||
|
|
<row>
|
||
|
|
<entry>basedir</entry>
|
||
|
|
<entry>string</entry>
|
||
|
|
<entry>no</entry>
|
||
|
|
<entry><emphasis>DOCUMENTROOT</emphasis></entry>
|
||
|
|
<entry>Basisverzeichnis für relative Pfadangaben</entry>
|
||
|
|
</row>
|
||
|
|
<row>
|
||
|
|
<entry>alt</entry>
|
||
|
|
<entry>string</entry>
|
||
|
|
<entry>no</entry>
|
||
|
|
<entry><emphasis>""</emphasis></entry>
|
||
|
|
<entry>Alternative Beschreibung des Bildes</entry>
|
||
|
|
</row>
|
||
|
|
<row>
|
||
|
|
<entry>href</entry>
|
||
|
|
<entry>string</entry>
|
||
|
|
<entry>no</entry>
|
||
|
|
<entry><emphasis>n/a</emphasis></entry>
|
||
|
|
<entry>Link für das Bild</entry>
|
||
|
|
</row>
|
||
|
|
</tbody>
|
||
|
|
</tgroup>
|
||
|
|
</informaltable>
|
||
|
|
<para>
|
||
|
|
html_image ist eine eigene Funktion die ein HTML Tag für ein Bild erzeugt.
|
||
|
|
Die Höhe und Breite der Ausgabe wird automatisch aus der Bilddatei berechnet
|
||
|
|
wenn die Werte nicht übergeben werden.
|
||
|
|
</para>
|
||
|
|
<para>
|
||
|
|
basedir ist der Basispfad der für die Verlinkung verwendet werden soll. Wenn kein
|
||
|
|
Wert übergeben wird, wird die Umgebungsvariable DOCUMENT_ROOT verwendet. Wenn Sicherheit
|
||
|
|
eingeschaltet ist, muss das Bild in einem sicheren Verzeichnis liegen.
|
||
|
|
</para>
|
||
|
|
<para>
|
||
|
|
<parameter>href</parameter> ist das href Attribut für das Image-Tag. Wenn dieser Wert übergeben wird,
|
||
|
|
wird um das Bild ein <a href="LINKVALUE"><a> Tag erzeugt.
|
||
|
|
</para>
|
||
|
|
<note>
|
||
|
|
<title>Technische Bemerkung</title>
|
||
|
|
<para>
|
||
|
|
html_image greift auf das Dateisystem zu um Höhe und Breite zu errechnen. Wenn Sie
|
||
|
|
caching nicht verwenden sollten Sie normalerweise auf diese Funktion aus performance Gründen verzichten.
|
||
|
|
</para>
|
||
|
|
</note>
|
||
|
|
<example>
|
||
|
|
<title>html_image</title>
|
||
|
|
<programlisting>
|
||
|
|
index.php:
|
||
|
|
|
||
|
|
require('Smarty.class.php');
|
||
|
|
$smarty = new Smarty;
|
||
|
|
$smarty->display('index.tpl');
|
||
|
|
|
||
|
|
index.tpl:
|
||
|
|
|
||
|
|
{html_image file="pumpkin.jpg"}
|
||
|
|
{html_image file="/path/from/docroot/pumpkin.jpg"}
|
||
|
|
{html_image file="../path/relative/to/currdir/pumpkin.jpg"}
|
||
|
|
|
||
|
|
AUSGABE: (möglich)
|
||
|
|
|
||
|
|
<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" /></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
|
||
|
|
-->
|