mirror of
https://github.com/smarty-php/smarty.git
synced 2025-11-06 15:21:37 +01:00
166 lines
4.9 KiB
XML
166 lines
4.9 KiB
XML
|
|
<?xml version="1.0" encoding="iso-8859-1"?>
|
|||
|
|
<!-- $Revision$ -->
|
|||
|
|
<sect1 id="language.variables.smarty">
|
|||
|
|
<title>La variable reservada {$smarty}</title>
|
|||
|
|
<para>
|
|||
|
|
La variable reservada {$smarty} puede ser utilizada para accesar a
|
|||
|
|
variables especiales del template. A continuaci<63>n una lista completa.
|
|||
|
|
</para>
|
|||
|
|
|
|||
|
|
<sect2 id="language.variables.smarty.request">
|
|||
|
|
<title>Solicitud de Variables</title>
|
|||
|
|
<para>
|
|||
|
|
La solicitud de variables como get, post, cookies, server, environment, y
|
|||
|
|
session pueden ser accesadas como se muestra en los ejemplos de abajo:
|
|||
|
|
</para>
|
|||
|
|
<example>
|
|||
|
|
<title>Mostrando peticiones de variables</title>
|
|||
|
|
<programlisting>
|
|||
|
|
<![CDATA[
|
|||
|
|
{* display value of page from URL (GET) http://www.domain.com/index.php?page=foo *}
|
|||
|
|
{$smarty.get.page}
|
|||
|
|
|
|||
|
|
{* display the variable "page" from a form (POST) *}
|
|||
|
|
{$smarty.post.page}
|
|||
|
|
|
|||
|
|
{* display the value of the cookie "username" *}
|
|||
|
|
{$smarty.cookies.username}
|
|||
|
|
|
|||
|
|
{* display the server variable "SERVER_NAME" *}
|
|||
|
|
{$smarty.server.SERVER_NAME}
|
|||
|
|
|
|||
|
|
{* display the system environment variable "PATH" *}
|
|||
|
|
{$smarty.env.PATH}
|
|||
|
|
|
|||
|
|
{* display the php session variable "id" *}
|
|||
|
|
{$smarty.session.id}
|
|||
|
|
|
|||
|
|
{* display the variable "username" from merged get/post/cookies/server/env *}
|
|||
|
|
{$smarty.request.username}
|
|||
|
|
]]>
|
|||
|
|
</programlisting>
|
|||
|
|
</example>
|
|||
|
|
<note>
|
|||
|
|
<para>
|
|||
|
|
Por historicas razones {$SCRIPT_NAME} puede ser accesado directamente
|
|||
|
|
sin embargo {$smarty.server.SCRIPT_NAME} es el sugerido para accesar
|
|||
|
|
este valor.
|
|||
|
|
</para>
|
|||
|
|
</note>
|
|||
|
|
</sect2>
|
|||
|
|
|
|||
|
|
<sect2 id="language.variables.smarty.now">
|
|||
|
|
<title>{$smarty.now}</title>
|
|||
|
|
<para>
|
|||
|
|
El timestamp actual puede ser accesado con {$smarty.now}.
|
|||
|
|
El n<>mero refleja el n<>mero de segundos pasados desde la
|
|||
|
|
llamada Epoca (1 de Enero de 1970) y puede ser pasado directamente
|
|||
|
|
para el modificador date_format para mostrar la fecha.
|
|||
|
|
</para>
|
|||
|
|
<example>
|
|||
|
|
<title>Usando {$smarty.now}</title>
|
|||
|
|
<programlisting>
|
|||
|
|
<![CDATA[
|
|||
|
|
{* utilice el modificador date_format para mostrar la fecha y hora actual *}
|
|||
|
|
{$smarty.now|date_format:"%Y-%m-%d %H:%M:%S"}
|
|||
|
|
]]>
|
|||
|
|
</programlisting>
|
|||
|
|
</example>
|
|||
|
|
</sect2>
|
|||
|
|
<sect2 id="language.variables.smarty.const">
|
|||
|
|
<title>{$smarty.const}</title>
|
|||
|
|
<para>
|
|||
|
|
Usted puede accesar el valor de constantes PHP directamente.
|
|||
|
|
</para>
|
|||
|
|
<example>
|
|||
|
|
<title>Usando {$smarty.const}</title>
|
|||
|
|
<programlisting>
|
|||
|
|
<![CDATA[
|
|||
|
|
{$smarty.const._MY_CONST_VAL}
|
|||
|
|
]]>
|
|||
|
|
</programlisting>
|
|||
|
|
</example>
|
|||
|
|
</sect2>
|
|||
|
|
|
|||
|
|
<sect2 id="language.variables.smarty.capture">
|
|||
|
|
<title>{$smarty.capture}</title>
|
|||
|
|
<para>
|
|||
|
|
La salida capturada via {capture}..{/capture} puede ser accesada
|
|||
|
|
usando la variable {$smarty}.
|
|||
|
|
vea la secci<63>n <link linkend="language.function.capture">capture</link>
|
|||
|
|
para un ejemplo.
|
|||
|
|
</para>
|
|||
|
|
</sect2>
|
|||
|
|
|
|||
|
|
<sect2 id="language.variables.smarty.config">
|
|||
|
|
<title>{$smarty.config}</title>
|
|||
|
|
<para>
|
|||
|
|
La variable {$smarty} puede ser usada para referir variables de
|
|||
|
|
configuraci<63>n cargadas.
|
|||
|
|
{$smarty.config.foo} es un sin<69>nimo para {#foo#}. vea la secci<63>n
|
|||
|
|
sobre <link linkend="language.function.config.load">config_load</link>
|
|||
|
|
para un ejemplo.
|
|||
|
|
</para>
|
|||
|
|
</sect2>
|
|||
|
|
|
|||
|
|
<sect2 id="language.variables.smarty.loops">
|
|||
|
|
<title>{$smarty.section}, {$smarty.foreach}</title>
|
|||
|
|
<para>
|
|||
|
|
La variable {$smarty} puede ser usada para hacer referencia a las
|
|||
|
|
propiedades 'section' y 'foreach' del loop. Ver la documentaci<63>n
|
|||
|
|
sobre <link linkend="language.function.section">section</link> y
|
|||
|
|
<link linkend="language.function.foreach">foreach</link>.
|
|||
|
|
</para>
|
|||
|
|
</sect2>
|
|||
|
|
|
|||
|
|
<sect2 id="language.variables.smarty.template">
|
|||
|
|
<title>{$smarty.template}</title>
|
|||
|
|
<para>
|
|||
|
|
Esta variable contiene el nombre actual del template que esta siendo
|
|||
|
|
procesado.
|
|||
|
|
</para>
|
|||
|
|
</sect2>
|
|||
|
|
<sect2 id="language.variables.smarty.version">
|
|||
|
|
<title>{$smarty.version}</title>
|
|||
|
|
<para>
|
|||
|
|
Esta variable contiene la versi<73>n Smarty con que es compilado el
|
|||
|
|
template.
|
|||
|
|
</para>
|
|||
|
|
</sect2>
|
|||
|
|
<sect2 id="language.variables.smarty.ldelim">
|
|||
|
|
<title>{$smarty.ldelim}</title>
|
|||
|
|
<para>
|
|||
|
|
Esta variable es usada para imprimir literalmente el valor left-delimiter.
|
|||
|
|
Ver tambien <link linkend="language.function.ldelim">{ldelim},{rdelim}</link>.
|
|||
|
|
</para>
|
|||
|
|
</sect2>
|
|||
|
|
<sect2 id="language.variables.smarty.rdelim">
|
|||
|
|
<title>{$smarty.rdelim}</title>
|
|||
|
|
<para>
|
|||
|
|
Esta variable es usada para imprimir literalmente el valor right-delimiter.
|
|||
|
|
Ver tambien <link linkend="language.function.ldelim">{rdelim},{rdelim}</link>.
|
|||
|
|
</para>
|
|||
|
|
</sect2>
|
|||
|
|
|
|||
|
|
</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
|
|||
|
|
-->
|