2004-10-07 18:50:52 +00:00
|
|
|
|
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
|
|
|
|
<!-- $Revision$ -->
|
|
|
|
|
|
<sect1 id="language.config.variables">
|
|
|
|
|
|
<title>Variables cargadas desde archivos de configuraci<63>n</title>
|
|
|
|
|
|
<para>
|
2005-11-08 23:37:29 +00:00
|
|
|
|
Las variables que son cargadas de
|
|
|
|
|
|
<link linkend="config.files">archivos de configuraci<63>n</link> son
|
2004-10-07 18:50:52 +00:00
|
|
|
|
referenciadas incluyendo entre ellas el signo(#), o como variables
|
|
|
|
|
|
de Smarty
|
|
|
|
|
|
<link linkend="language.variables.smarty.config">$smarty.config</link>.
|
|
|
|
|
|
La segunda sintaxis es util para incrustar valores de un atributo
|
|
|
|
|
|
dentro de comillas.
|
|
|
|
|
|
</para>
|
|
|
|
|
|
<example>
|
|
|
|
|
|
<title>Variables de configuraci<63>n</title>
|
|
|
|
|
|
<para>
|
|
|
|
|
|
foo.conf:
|
|
|
|
|
|
</para>
|
|
|
|
|
|
<programlisting>
|
|
|
|
|
|
<![CDATA[
|
|
|
|
|
|
pageTitle = "This is mine"
|
|
|
|
|
|
bodyBgColor = "#eeeeee"
|
|
|
|
|
|
tableBorderSize = "3"
|
|
|
|
|
|
tableBgColor = "#bbbbbb"
|
|
|
|
|
|
rowBgColor = "#cccccc"
|
|
|
|
|
|
]]>
|
|
|
|
|
|
</programlisting>
|
|
|
|
|
|
<para>
|
|
|
|
|
|
index.tpl:
|
|
|
|
|
|
</para>
|
|
|
|
|
|
<programlisting>
|
|
|
|
|
|
<![CDATA[
|
|
|
|
|
|
{config_load file="foo.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>
|
|
|
|
|
|
<para>
|
2005-11-08 23:37:29 +00:00
|
|
|
|
index.tpl: (sintaxis alternativa)
|
2004-10-07 18:50:52 +00:00
|
|
|
|
</para>
|
|
|
|
|
|
<programlisting>
|
|
|
|
|
|
<![CDATA[
|
|
|
|
|
|
{config_load file="foo.conf"}
|
|
|
|
|
|
<html>
|
|
|
|
|
|
<title>{$smarty.config.pageTitle}</title>
|
|
|
|
|
|
<body bgcolor="{$smarty.config.bodyBgColor}">
|
|
|
|
|
|
<table border="{$smarty.config.tableBorderSize}" bgcolor="{$smarty.config.tableBgColor}">
|
|
|
|
|
|
<tr bgcolor="{$smarty.config.rowBgColor}">
|
|
|
|
|
|
<td>First</td>
|
|
|
|
|
|
<td>Last</td>
|
|
|
|
|
|
<td>Address</td>
|
|
|
|
|
|
</tr>
|
|
|
|
|
|
</table>
|
|
|
|
|
|
</body>
|
|
|
|
|
|
</html>
|
|
|
|
|
|
]]>
|
|
|
|
|
|
</programlisting>
|
|
|
|
|
|
<para>
|
2005-11-08 23:37:29 +00:00
|
|
|
|
esta es la salida de ambos ejemplos:
|
2004-10-07 18:50:52 +00:00
|
|
|
|
</para>
|
|
|
|
|
|
<screen>
|
|
|
|
|
|
<![CDATA[
|
|
|
|
|
|
<html>
|
|
|
|
|
|
<title>This is mine</title>
|
|
|
|
|
|
<body bgcolor="#eeeeee">
|
|
|
|
|
|
<table border="3" bgcolor="#bbbbbb">
|
|
|
|
|
|
<tr bgcolor="#cccccc">
|
|
|
|
|
|
<td>First</td>
|
|
|
|
|
|
<td>Last</td>
|
|
|
|
|
|
<td>Address</td>
|
|
|
|
|
|
</tr>
|
|
|
|
|
|
</table>
|
|
|
|
|
|
</body>
|
|
|
|
|
|
</html>
|
|
|
|
|
|
]]>
|
|
|
|
|
|
</screen>
|
|
|
|
|
|
</example>
|
|
|
|
|
|
<para>
|
|
|
|
|
|
Las variables de un archivo de configuraci<63>n no pueden ser
|
|
|
|
|
|
usadas hasta despu<70>s de que son cargadas por los archivos de
|
|
|
|
|
|
configuraci<63>n.
|
|
|
|
|
|
Este procedimento es explicado posteriormente en este documento en
|
2005-11-08 23:37:29 +00:00
|
|
|
|
<link linkend="language.function.config.load"><command>{config_load}</command></link>.
|
2004-10-07 18:50:52 +00:00
|
|
|
|
</para>
|
2005-11-08 23:37:29 +00:00
|
|
|
|
<para>
|
|
|
|
|
|
Ver tambi<62>n <link linkend="language.syntax.variables">Variables</link> y
|
|
|
|
|
|
<link linkend="language.variables.smarty">$smarty reserved variables</link>
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
2004-10-07 18:50:52 +00:00
|
|
|
|
</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
|
|
|
|
|
|
-->
|