2004-04-13 08:46:28 +00:00
|
|
|
|
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
|
|
|
|
<!-- $Revision$ -->
|
2004-10-02 12:49:29 +00:00
|
|
|
|
<!-- EN-Revision: 1.2 Maintainer: thomasgm Status: ready -->
|
2004-04-13 08:46:28 +00:00
|
|
|
|
<sect1 id="language.function.fetch">
|
|
|
|
|
|
<title>fetch</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>
|
|
|
|
|
|
<entry>O arquivo, site http ou ftp para obter</entry>
|
|
|
|
|
|
</row>
|
|
|
|
|
|
<row>
|
|
|
|
|
|
<entry>assign</entry>
|
|
|
|
|
|
<entry>string</entry>
|
|
|
|
|
|
<entry>N<EFBFBD>o</entry>
|
|
|
|
|
|
<entry><emphasis>n/a</emphasis></entry>
|
|
|
|
|
|
<entry>A vari<72>vel de template
|
|
|
|
|
|
que vai receber a sa<73>da</entry>
|
|
|
|
|
|
</row>
|
|
|
|
|
|
</tbody>
|
|
|
|
|
|
</tgroup>
|
|
|
|
|
|
</informaltable>
|
|
|
|
|
|
<para>
|
|
|
|
|
|
fetch <20> usado para obter arquivos do sistema de arquivos local,
|
|
|
|
|
|
http ou ftp, e mostrar o seu conte<74>do. Se o nome do arquivo come<6D>ar
|
2004-10-01 14:39:42 +00:00
|
|
|
|
com "http://", a p<>gina do web site ser<65> obtida e mostrada. Se o
|
2004-04-13 08:46:28 +00:00
|
|
|
|
nome do arquivo come<6D>ar com "ftp://", o arquivo ser<65> obtido do servidor
|
|
|
|
|
|
ftp e mostrado. Para arquivos locais, o caminho completo do sistema de
|
|
|
|
|
|
arquivos deve ser dado, ou um caminho relativo ao script php executado.
|
|
|
|
|
|
</para>
|
|
|
|
|
|
<para>
|
|
|
|
|
|
Se voc<6F> indicar o atributo especial "assign", a sa<73>da da fun<75><6E>o
|
2004-10-01 14:39:42 +00:00
|
|
|
|
fetch ser<65> passada para uma vari<72>vel de template ao inv<6E>s de
|
2004-04-13 08:46:28 +00:00
|
|
|
|
ser mostrado no template. (novo no Smarty 1.5.0)
|
|
|
|
|
|
</para>
|
|
|
|
|
|
<note>
|
|
|
|
|
|
<title>Nota T<>cnica</title>
|
|
|
|
|
|
<para>
|
2004-10-01 14:39:42 +00:00
|
|
|
|
fetch n<>o suporta redirecionamento http, tenha
|
|
|
|
|
|
certeza de incluir a barra no final aonde necess<73>rio.
|
2004-04-13 08:46:28 +00:00
|
|
|
|
</para>
|
|
|
|
|
|
</note>
|
|
|
|
|
|
<note>
|
|
|
|
|
|
<title>Nota T<>cnica</title>
|
|
|
|
|
|
<para>
|
|
|
|
|
|
Se a seguran<61>a do template esta ativada e voc<6F>
|
2004-10-01 14:39:42 +00:00
|
|
|
|
estiver obtendo um arquivo do sistema de arquivos locais, fetch
|
|
|
|
|
|
ir<69> funcionar apenas em arquivos de um dos diret<65>rios
|
2004-04-13 08:46:28 +00:00
|
|
|
|
definidos como seguros. ($secure_dir)
|
|
|
|
|
|
</para>
|
|
|
|
|
|
</note>
|
|
|
|
|
|
<example>
|
|
|
|
|
|
<title>fetch</title>
|
|
|
|
|
|
<programlisting>
|
2004-10-01 14:39:42 +00:00
|
|
|
|
<![CDATA[
|
2004-04-13 08:46:28 +00:00
|
|
|
|
{* inclui algum javascript no seu template *}
|
|
|
|
|
|
{fetch file="/export/httpd/www.domain.com/docs/navbar.js"}
|
|
|
|
|
|
|
|
|
|
|
|
{* embute algum texto sobre o tempo de outro web site *}
|
|
|
|
|
|
{fetch file="http://www.myweather.com/68502/"}
|
|
|
|
|
|
|
|
|
|
|
|
{* obt<62>m um arquivo de not<6F>cias via ftp *}
|
|
|
|
|
|
{fetch file="ftp://user:password@ftp.domain.com/path/to/currentheadlines.txt"}
|
|
|
|
|
|
|
|
|
|
|
|
{* coloca o conte<74>do obtido para uma var<61>vel de template *}
|
|
|
|
|
|
{fetch file="http://www.myweather.com/68502/" assign="weather"}
|
|
|
|
|
|
{if $weather ne ""}
|
2004-10-01 14:39:42 +00:00
|
|
|
|
<b>{$weather}</b>
|
|
|
|
|
|
{/if}
|
|
|
|
|
|
]]>
|
|
|
|
|
|
</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
|
|
|
|
|
|
-->
|