2004-04-13 08:46:28 +00:00
|
|
|
|
<?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 do Atributo</entry>
|
|
|
|
|
|
<entry>Tipo</entry>
|
2004-10-01 14:39:42 +00:00
|
|
|
|
<entry>Obrigat<EFBFBD>rio</entry>
|
2004-04-13 08:46:28 +00:00
|
|
|
|
<entry>Padr<EFBFBD>o</entry>
|
|
|
|
|
|
<entry>Descri<EFBFBD><EFBFBD>o</entry>
|
|
|
|
|
|
</row>
|
|
|
|
|
|
</thead>
|
|
|
|
|
|
<tbody>
|
|
|
|
|
|
<row>
|
|
|
|
|
|
<entry>file</entry>
|
|
|
|
|
|
<entry>string</entry>
|
|
|
|
|
|
<entry>Sim</entry>
|
|
|
|
|
|
<entry><emphasis>n/a</emphasis></entry>
|
2004-10-01 14:39:42 +00:00
|
|
|
|
<entry>nome/caminho para a imagem</entry>
|
2004-04-13 08:46:28 +00:00
|
|
|
|
</row>
|
|
|
|
|
|
<row>
|
|
|
|
|
|
<entry>border</entry>
|
|
|
|
|
|
<entry>string</entry>
|
|
|
|
|
|
<entry>N<EFBFBD>o</entry>
|
|
|
|
|
|
<entry><emphasis>0</emphasis></entry>
|
|
|
|
|
|
<entry>tamanho da borda de contorno da imagem</entry>
|
|
|
|
|
|
</row>
|
|
|
|
|
|
<row>
|
|
|
|
|
|
<entry>height</entry>
|
|
|
|
|
|
<entry>string</entry>
|
|
|
|
|
|
<entry>N<EFBFBD>o</entry>
|
|
|
|
|
|
<entry><emphasis>altura atual da imagem</emphasis></entry>
|
|
|
|
|
|
<entry>altura com a qual a imagem deve ser mostrada</entry>
|
|
|
|
|
|
</row>
|
|
|
|
|
|
<row>
|
|
|
|
|
|
<entry>width</entry>
|
|
|
|
|
|
<entry>string</entry>
|
|
|
|
|
|
<entry>N<EFBFBD>o</entry>
|
|
|
|
|
|
<entry><emphasis>largura atual da imagem</emphasis></entry>
|
|
|
|
|
|
<entry>largura com a qual a imagem deve ser mostrada</entry>
|
|
|
|
|
|
</row>
|
|
|
|
|
|
<row>
|
|
|
|
|
|
<entry>basedir</entry>
|
|
|
|
|
|
<entry>string</entry>
|
|
|
|
|
|
<entry>N<EFBFBD>o</entry>
|
|
|
|
|
|
<entry><emphasis>doc root do servidor</emphasis></entry>
|
|
|
|
|
|
<entry>diret<EFBFBD>rio de base a caminhos relativos</entry>
|
|
|
|
|
|
</row>
|
|
|
|
|
|
<row>
|
|
|
|
|
|
<entry>alt</entry>
|
|
|
|
|
|
<entry>string</entry>
|
|
|
|
|
|
<entry>N<EFBFBD>o</entry>
|
|
|
|
|
|
<entry><emphasis>""</emphasis></entry>
|
|
|
|
|
|
<entry>descri<EFBFBD><EFBFBD>o alternativa da imagem</entry>
|
|
|
|
|
|
</row>
|
|
|
|
|
|
<row>
|
|
|
|
|
|
<entry>href</entry>
|
|
|
|
|
|
<entry>string</entry>
|
|
|
|
|
|
<entry>N<EFBFBD>o</entry>
|
|
|
|
|
|
<entry><emphasis>n/a</emphasis></entry>
|
2004-10-01 14:39:42 +00:00
|
|
|
|
<entry>valor href para aonde a imagem ser<65> linkada</entry>
|
2004-04-13 08:46:28 +00:00
|
|
|
|
</row>
|
|
|
|
|
|
</tbody>
|
|
|
|
|
|
</tgroup>
|
|
|
|
|
|
</informaltable>
|
|
|
|
|
|
<para>
|
|
|
|
|
|
html_image <20> uma fun<75><6E>o customizada que gera uma tag HTML para uma imagem.
|
|
|
|
|
|
A altura e a largura s<>o automaticamente calculadas a partir do arquivo de imagem se
|
|
|
|
|
|
nenhum valor <20> fornecido.
|
|
|
|
|
|
</para>
|
|
|
|
|
|
<para>
|
|
|
|
|
|
basedir <20> o diret<65>rio base do qual caminhos relativos de imagens est<73>o baseados.
|
|
|
|
|
|
Se n<>o fornecido, o document root do servidor (vari<72>vel de ambiente DOCUMENT_ROOT) <20> usada
|
|
|
|
|
|
como o diret<65>rio base. Se a seguran<61>a est<73> habilitada, o caminho para a imagem deve estar dentro
|
|
|
|
|
|
de um diret<65>rio seguro.
|
|
|
|
|
|
</para>
|
|
|
|
|
|
<para>
|
2004-10-01 14:39:42 +00:00
|
|
|
|
<parameter>href</parameter> <20> o valor href para onde a imagem ser<65> linkada. Se um link <20> fornecido,
|
2004-04-13 08:46:28 +00:00
|
|
|
|
uma tag <a href="LINKVALUE"><a> <20> posta em volta da tag da imagem.
|
|
|
|
|
|
</para>
|
|
|
|
|
|
<note>
|
|
|
|
|
|
<title>Nota T<>cnica</title>
|
|
|
|
|
|
<para>
|
2004-10-01 14:39:42 +00:00
|
|
|
|
html_image requer um acesso ao disco para ler a imagem e calcular
|
2004-04-13 08:46:28 +00:00
|
|
|
|
a altura e a largura. Se voc<6F> n<>o usa caching de template, normalmente <20>
|
|
|
|
|
|
melhor evitar html_image e deixar as tags de imagem est<73>ticas para performance
|
|
|
|
|
|
otimizada.
|
|
|
|
|
|
</para>
|
|
|
|
|
|
</note>
|
|
|
|
|
|
<example>
|
|
|
|
|
|
<title>html_image</title>
|
|
|
|
|
|
<programlisting>
|
2004-10-01 14:39:42 +00:00
|
|
|
|
<![CDATA[
|
2004-04-13 08:46:28 +00:00
|
|
|
|
index.php:
|
|
|
|
|
|
|
|
|
|
|
|
require('Smarty.class.php');
|
|
|
|
|
|
$smarty = new Smarty;
|
2004-10-01 14:39:42 +00:00
|
|
|
|
$smarty->display('index.tpl');
|
2004-04-13 08:46:28 +00:00
|
|
|
|
|
|
|
|
|
|
index.tpl:
|
|
|
|
|
|
|
|
|
|
|
|
{html_image file="pumpkin.jpg"}
|
|
|
|
|
|
{html_image file="/path/from/docroot/pumpkin.jpg"}
|
|
|
|
|
|
{html_image file="../path/relative/to/currdir/pumpkin.jpg"}
|
|
|
|
|
|
|
2004-10-01 14:39:42 +00:00
|
|
|
|
MOSTRA: (poss<73>vel)
|
2004-04-13 08:46:28 +00:00
|
|
|
|
|
2004-10-01 14:39:42 +00:00
|
|
|
|
<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>
|
2004-04-13 08:46:28 +00:00
|
|
|
|
</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
|
|
|
|
|
|
-->
|