mirror of
https://github.com/smarty-php/smarty.git
synced 2025-11-06 07:11:37 +01:00
110 lines
3.2 KiB
XML
110 lines
3.2 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>Nombre del Atributo</entry>
|
|
<entry>Tipo</entry>
|
|
<entry>Requerido</entry>
|
|
<entry>Default</entry>
|
|
<entry>Descripción</entry>
|
|
</row>
|
|
</thead>
|
|
<tbody>
|
|
<row>
|
|
<entry>file</entry>
|
|
<entry>string</entry>
|
|
<entry>Si</entry>
|
|
<entry><emphasis>n/a</emphasis></entry>
|
|
<entry>El archivo, sitio http o ftp para mandar llamar</entry>
|
|
</row>
|
|
<row>
|
|
<entry>assign</entry>
|
|
<entry>string</entry>
|
|
<entry>No</entry>
|
|
<entry><emphasis>n/a</emphasis></entry>
|
|
<entry>La variable del template que va a recibir la salida</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</informaltable>
|
|
<para>
|
|
fetch es usado para obtener archivos de sistema local, http o ftp, y
|
|
mostrar el contenido. Si el nombre del archivo comienza con "http://",
|
|
la página del web site sera traida y mostrada. Si el nombre del archivo
|
|
comienza con "ftp://", el archivo será obtenido del servidor ftp y
|
|
mostrado. Para archivos locales, debe ser dada la ruta completa del
|
|
sistema de archivos, o una ruta relativa de el script php a ejecutar.
|
|
</para>
|
|
<para>
|
|
Si usted indica el atributo especial "assign", la salida de la función
|
|
fetch se ira a una variable de template en vez de ser mostrada en el
|
|
template. (nuevo en Smarty 1.5.0)
|
|
</para>
|
|
<note>
|
|
<title>Nota Técnica</title>
|
|
<para>
|
|
Esto no soporta redirecionamento http, tenga la certeza de incluir
|
|
en la barra el seguimiento para ir a buscar donde sea necesario.
|
|
</para>
|
|
</note>
|
|
<note>
|
|
<title>Nota Técnica</title>
|
|
<para>
|
|
Si tiene activada la seguridad en su template y usted estuviera
|
|
recibiendo un archivo del sistema de archivos local, esto permitira
|
|
que solo archivos de uno de los directorios estuviera definido como
|
|
seguro. ($secure_dir)
|
|
</para>
|
|
</note>
|
|
<example>
|
|
<title>fetch</title>
|
|
<programlisting>
|
|
<![CDATA[
|
|
{* Incluye algunos javascript en su template *}
|
|
{fetch file="/export/httpd/www.domain.com/docs/navbar.js"}
|
|
|
|
{* Incrusta algun texto sobre el template desde otro sitio web *}
|
|
{fetch file="http://www.myweather.com/68502/"}
|
|
|
|
{* Obtiene un archivo de noticias via ftp *}
|
|
{fetch file="ftp://user:password@ftp.domain.com/path/to/currentheadlines.txt"}
|
|
|
|
{* coloca el contenido en una variable 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
|
|
-->
|