mirror of
https://github.com/smarty-php/smarty.git
synced 2025-11-06 07:11:37 +01:00
107 lines
3.7 KiB
XML
107 lines
3.7 KiB
XML
|
|
<?xml version="1.0" encoding="iso-8859-1"?>
|
|||
|
|
<!-- $Revision$ -->
|
|||
|
|
<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>
|
|||
|
|
<entry>Requerido</entry>
|
|||
|
|
<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
|
|||
|
|
com "http://", a p<>gina do web site ser<65> obtidae mostrada. Se o
|
|||
|
|
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
|
|||
|
|
fetch ir<69> para uma vari<72>vel de template ao iv<69>s de
|
|||
|
|
ser mostrado no template. (novo no Smarty 1.5.0)
|
|||
|
|
</para>
|
|||
|
|
<note>
|
|||
|
|
<title>Nota T<>cnica</title>
|
|||
|
|
<para>
|
|||
|
|
Isto n<>o suporta redirecionamento http, tenha
|
|||
|
|
certesa de incluir a barra no final aonde necess<73>rio.
|
|||
|
|
</para>
|
|||
|
|
</note>
|
|||
|
|
<note>
|
|||
|
|
<title>Nota T<>cnica</title>
|
|||
|
|
<para>
|
|||
|
|
Se a seguran<61>a do template esta ativada e voc<6F>
|
|||
|
|
estiver obtendo um arquivo do sistema de arquivos local, isto
|
|||
|
|
ir<69> permitir apenas arquivos de um dos diret<65>rios
|
|||
|
|
definidos como seguros. ($secure_dir)
|
|||
|
|
</para>
|
|||
|
|
</note>
|
|||
|
|
<example>
|
|||
|
|
<title>fetch</title>
|
|||
|
|
<programlisting>
|
|||
|
|
{* 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 ""}
|
|||
|
|
<b>{$weather}</b>
|
|||
|
|
{/if}</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
|
|||
|
|
-->
|