Files
smarty/docs/es/designers/language-builtin-functions/language-function-config-load.xml

149 lines
3.9 KiB
XML
Raw Normal View History

2004-10-07 18:50:52 +00:00
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ -->
<sect1 id="language.function.config.load">
<title>config_load</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<EFBFBD>n</entry>
</row>
</thead>
<tbody>
<row>
<entry>file</entry>
<entry>string</entry>
<entry>Si</entry>
<entry><emphasis>n/a</emphasis></entry>
<entry>El nombre del archivo de configuraci<63>n a incluir</entry>
</row>
<row>
<entry>section</entry>
<entry>string</entry>
<entry>No</entry>
<entry><emphasis>n/a</emphasis></entry>
<entry>El nombre de la secci<63>n a cargar</entry>
</row>
<row>
<entry>scope</entry>
<entry>string</entry>
<entry>no</entry>
<entry><emphasis>local</emphasis></entry>
<entry>
Como el scope carga las variables debe ser tratado de
manera local, como padre y no como global. local indica
que las variables son cargadas en el contexto del template
local. parent indica que las variables son cargadas en el
contexto actual y en el template que llamo. global indica
que las variables estan disponibles para todos los templates.
</entry>
</row>
<row>
<entry>global</entry>
<entry>boolean</entry>
<entry>No</entry>
<entry><emphasis>No</emphasis></entry>
<entry>
Cuando las variables no son vistas en el template
padre (al que llamo este), lo mismo que scope=parent.
NOTA: este atributo esta obsoleto pero el atributo scope,
puede dar el soporte. Si scope es el indicado, este valor
es ignorado.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
<para>
Esta funci<63>n es usada para cargar las variables de un archivo de
configuraci<63>n dentro de un template.
Vea <link linkend="config.files">Config Files</link> para mayor
informaci<63>n.
</para>
<example>
<title>funci<EFBFBD>n config_load</title>
<programlisting>
<![CDATA[
{config_load file="colors.conf"}
<html>
<title>{#pageTitle#}</title>
<body bgcolor="{#bodyBgColor#}">
<table border="{#tableBorderSize#}" bgcolor="{#tableBgColor#}">
<tr bgcolor="{#rowBgColor#}">
<td>First</td>
<td>Last</td>
<td>Address</td>
</tr>
</table>
</body>
</html>
]]>
</programlisting>
</example>
<para>
Los archivos de configuraci<63>n pueden contener secciones tambi<62>n.
Usted puede cargar variables de una secci<63>n adicionando el atributo
<emphasis>section</emphasis>.
</para>
<note>
<para>
<emphasis>Config file sections</emphasis> es la funci<63>n integrada
de template <emphasis>section</emphasis> no tiene nada que ver
uno con el otro, ellos justamente por casualidad tiene en com<6F>n el
convensionalismo del nombre.
</para>
</note>
<example>
<title>Funci<EFBFBD>n config_load con section</title>
<programlisting>
<![CDATA[
{config_load file="colors.conf" section="Customer"}
<html>
<title>{#pageTitle#}</title>
<body bgcolor="{#bodyBgColor#}">
<table border="{#tableBorderSize#}" bgcolor="{#tableBgColor#}">
<tr bgcolor="{#rowBgColor#}">
<td>First</td>
<td>Last</td>
<td>Address</td>
</tr>
</table>
</body>
</html>
]]>
</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
-->