mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-05 19:04:27 +02:00
spanish docs initial commit
This commit is contained in:
29
docs/es/appendixes/bugs.xml
Normal file
29
docs/es/appendixes/bugs.xml
Normal file
@@ -0,0 +1,29 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<chapter id="bugs">
|
||||
<title>ERRORES</title>
|
||||
<para>
|
||||
Revise el archivo de <filename>BUGS</filename> que viene con
|
||||
la ultima distribuci<63>n del Smarty, o Revise el website.
|
||||
</para>
|
||||
</chapter>
|
||||
<!-- 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
|
||||
-->
|
32
docs/es/appendixes/resources.xml
Normal file
32
docs/es/appendixes/resources.xml
Normal file
@@ -0,0 +1,32 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<chapter id="resources">
|
||||
<title>Fuentes</title>
|
||||
<para>
|
||||
La pagina principal del Smarty est<73> localizada en
|
||||
<ulink url="&url.smarty;">&url.smarty;</ulink>.
|
||||
Usted puede ingresar a la lista de email enviando un e-mail a
|
||||
&ml.general.sub;. El archivo de la lista de e-mail puede ser
|
||||
visto en <ulink url="&url.ml.archive;">&url.ml.archive;</ulink>.
|
||||
</para>
|
||||
</chapter>
|
||||
<!-- 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
|
||||
-->
|
386
docs/es/appendixes/tips.xml
Normal file
386
docs/es/appendixes/tips.xml
Normal file
@@ -0,0 +1,386 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<chapter id="tips">
|
||||
<title>Consejos y Trucos</title>
|
||||
<para>
|
||||
</para>
|
||||
<sect1 id="tips.blank.var.handling">
|
||||
<title>Manipulaci<EFBFBD>n de Variables Vacias</title>
|
||||
<para>
|
||||
Cuando usted en algunas ocaciones quiere imprimir un valor que
|
||||
usted def<65>ne a una variable vacia en vez de imprimir nada, tal
|
||||
como imprimir "&nbsp;" a fin de que el plano del fondo de
|
||||
la tabla funcione correctamente. Muchos usarian una sentencia
|
||||
{if} para manejar esto, mas existe otra forma con Smarty, usando
|
||||
el modificador de la variable <emphasis>default</emphasis>.
|
||||
</para>
|
||||
<example>
|
||||
<title>Imprimiendo &nbsp; cuando una variable esta vacia</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{* the long way *}
|
||||
|
||||
{if $title eq ""}
|
||||
|
||||
{else}
|
||||
{$title}
|
||||
{/if}
|
||||
|
||||
|
||||
{* the short way *}
|
||||
|
||||
{$title|default:" "}
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="tips.default.var.handling">
|
||||
<title>Manipulaci<EFBFBD>n del valor default de una variable</title>
|
||||
<para>
|
||||
Si una variable es usada frecuentemente en sus templates,
|
||||
aplicando el modificador default toda vez que este es
|
||||
mencionado puede evitar un bit desagradable. Usted puede
|
||||
remediar esto con la atribuci<63>n de un valor por default a
|
||||
la variable con la funci<63>n
|
||||
<link linkend="language.function.assign">assign</link>.
|
||||
</para>
|
||||
<example>
|
||||
<title>Atribuyendo el valor por default a una variable en el template</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{* ponga esto en algun lugar en la parte de arriba de su template *}
|
||||
{assign var="title" value=$title|default:"no title"}
|
||||
|
||||
{* Si el $titulo estaba vacio, este ahora tendra el valor "sin titulo" cuando
|
||||
usted lo exiba *}
|
||||
{$title}
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</sect1>
|
||||
<sect1 id="tips.passing.vars">
|
||||
<title>Pasando la variable titulo a la cabecera del template</title>
|
||||
<para>
|
||||
Cuando la mayoria de sus templates usan los mismo encabezados y
|
||||
los mismos pies de pagina, es com<6F>n dividirlos uno en cada template
|
||||
y entonces incluirlos. Que pasara si el encabezado necesita tener
|
||||
un titulo diferente, dependiendo de que pagina estas viniendo?
|
||||
usted puede pasar el titulo en el encabezado cuando este es incluido.
|
||||
</para>
|
||||
<example>
|
||||
<title>Pasando la variable titulo al encabezado del template</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
mainpage.tpl
|
||||
------------
|
||||
|
||||
{include file="header.tpl" title="Main Page"}
|
||||
{* El cuerpo del template viene aqu<71> *}
|
||||
{include file="footer.tpl"}
|
||||
|
||||
|
||||
archives.tpl
|
||||
------------
|
||||
|
||||
{config_load file="archive_page.conf"}
|
||||
{include file="header.tpl" title=#archivePageTitle#}
|
||||
{* El cuerpo del template viene aqu<71> *}
|
||||
{include file="footer.tpl"}
|
||||
|
||||
|
||||
header.tpl
|
||||
----------
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>{$title|default:"BC News"}</TITLE>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
|
||||
|
||||
footer.tpl
|
||||
----------
|
||||
</BODY>
|
||||
</HTML>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Cuando la pagina principal es mostrada, el titulo de la "P<>gina
|
||||
Principal" es pasado al template header.tpl, y ser<65> posteriormente
|
||||
usado como el titulo. Cuando la pagina de archivo es mostrada, el
|
||||
titulo sera "Archivos". Observelo en el ejemplo de archivo, nosotros
|
||||
estamos usando una variable del archivo archives_page.conf en vez de
|
||||
una variable codificada rigida. Tambien note que "BC news" es mostrada
|
||||
si la variable $titulo no esta definida, usando el modificador de la
|
||||
variable <emphasis>default</emphasis>.
|
||||
</para>
|
||||
</sect1>
|
||||
<sect1 id="tips.dates">
|
||||
<title>Fechas</title>
|
||||
<para>
|
||||
Como una regla basica, siempre pase fechas al Smarty como timestamps.
|
||||
Esto permite al dise<73>ador de template utilizar
|
||||
<link linkend="language.modifier.date.format">date_format</link>
|
||||
para el control completo sobre el formato de fechas, y tambi<62>n
|
||||
facilita la comparaci<63>n de fechas si es necesario.
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
En el Smarty 1.4.0, usted puede parsar fechas al Smarty como
|
||||
timestamps unix,mysql, o cualquier otra fecha interpretable
|
||||
por strtotime().
|
||||
</para>
|
||||
</note>
|
||||
<example>
|
||||
<title>Usando date_format</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{$startDate|date_format}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Esta es la salida:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Jan 4, 2001
|
||||
]]>
|
||||
</screen>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{$startDate|date_format:"%Y/%m/%d"}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Esta es la Salida:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
2001/01/04
|
||||
]]>
|
||||
</screen>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{if $date1 < $date2}
|
||||
...
|
||||
{/if}
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Cuando usa {html_select_date} en un template, el programador
|
||||
normalmente va a querer convertir la salida de un formulario
|
||||
de vuelta al formato timestamp. Aqu<71> esta una funci<63>n para
|
||||
ayudar con esto.
|
||||
</para>
|
||||
<example>
|
||||
<title>Convirtiendo elementos en forma de fecha de vuelta a un timestamp</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
// esto asume que la forma de sus elementos son nombradas como
|
||||
// startDate_Day, startDate_Month, startDate_Year
|
||||
|
||||
$startDate = makeTimeStamp($startDate_Year, $startDate_Month, $startDate_Day);
|
||||
|
||||
function makeTimeStamp($year="", $month="", $day="")
|
||||
{
|
||||
if(empty($year)) {
|
||||
$year = strftime("%Y");
|
||||
}
|
||||
if(empty($month)) {
|
||||
$month = strftime("%m");
|
||||
}
|
||||
if(empty($day)) {
|
||||
$day = strftime("%d");
|
||||
}
|
||||
|
||||
return mktime(0, 0, 0, $month, $day, $year);
|
||||
}
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</sect1>
|
||||
<sect1 id="tips.wap">
|
||||
<title>WAP/WML</title>
|
||||
<para>
|
||||
Los templates WAP/WML requieren de un encabezado de Content-Type de
|
||||
PHP para ser pasado junto con el template. La forma mas f<>cil de
|
||||
hacer esto seria escribir una funci<63>n de manera habitual que imprima
|
||||
el encabezado. Si usted esta usando el sistema de cache, este no
|
||||
funcionara, entonces nosotros haremos esto usando una etiqueta de
|
||||
insert (recuerde que las etiquetas insert no son "cacheadas!").
|
||||
Asegurarse que no exista ninguna salida al navegador antes del template,
|
||||
de otro modo el encabezado fallara.
|
||||
</para>
|
||||
<example>
|
||||
<title>Usando insert para escribir un encabezado WML Content-Type</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
// Asegurarse que el apache esta configurado para las extenciones .wml !
|
||||
// ponga esta funci<63>n en algun lugar de su aplicaci<63>n, o en Smarty.addons.php
|
||||
function insert_header($params)
|
||||
{
|
||||
// this function expects $content argument
|
||||
if (empty($params['content'])) {
|
||||
return;
|
||||
}
|
||||
header($params['content']);
|
||||
return;
|
||||
}
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Su template de Smarty <emphasis>debe</emphasis> comenzar con la etiqueta
|
||||
insert, como en el ejemplo:
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{insert name=header content="Content-Type: text/vnd.wap.wml"}
|
||||
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
|
||||
|
||||
<!-- begin new wml deck -->
|
||||
<wml>
|
||||
<!-- begin first card -->
|
||||
<card>
|
||||
<do type="accept">
|
||||
<go href="#two"/>
|
||||
</do>
|
||||
<p>
|
||||
Welcome to WAP with Smarty!
|
||||
Press OK to continue...
|
||||
</p>
|
||||
</card>
|
||||
<!-- begin second card -->
|
||||
<card id="two">
|
||||
<p>
|
||||
Pretty easy isn't it?
|
||||
</p>
|
||||
</card>
|
||||
</wml>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</sect1>
|
||||
<sect1 id="tips.componentized.templates">
|
||||
<title>Templates con Componetes</title>
|
||||
<para>
|
||||
Tradicionalmente, programar templates en sus aplicaciones sigue
|
||||
esta forma: Primero, usted acumula sus variables dentro de su
|
||||
aplicaci<63>n PHP, (talvez como requisiciones de una base de datos).
|
||||
Entonces, usted instancia su objeto Smarty, atribuye valores a
|
||||
las variables y muestra el template. Por ejemplo nosotros tenemos
|
||||
un registrador de existencias en nuestro template. Nosotros
|
||||
recolectaremos los datos de las existencias en nuestra aplicaci<63>n,
|
||||
entonces damos valor a estas variables en el template y lo mostramos.
|
||||
Ahora esto seria genial si usted adicionara este registrador de
|
||||
almacenamiento (stock ticker) a cualquier aplicaci<63>n simplemente
|
||||
incluyendolo en el template, y no preocuparse hacerca de como ir
|
||||
a traer los datos al frente?
|
||||
</para>
|
||||
<para>
|
||||
Usted puede escribir este plugin haciendo que traiga un
|
||||
contenido y asignarlo a la variable del template.
|
||||
</para>
|
||||
<example>
|
||||
<title>Templates con Componetes</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
// drop file "function.load_ticker.php" in plugin directory
|
||||
|
||||
// configura nuestra función para traer los datos almacenados
|
||||
function fetch_ticker($symbol)
|
||||
{
|
||||
// ponga la l<>gica aqu<71> que traera $ticker_name
|
||||
// y $ticker_price de algun recurso
|
||||
return $ticker_info;
|
||||
}
|
||||
|
||||
function smarty_function_load_ticker($params, &$smarty)
|
||||
{
|
||||
// llama la funci<63>n
|
||||
$ticker_info = fetch_ticker($params['symbol']);
|
||||
|
||||
// asigna las variables al template
|
||||
$smarty->assign($params['assign'], $ticker_info);
|
||||
}
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
index.tpl
|
||||
---------
|
||||
|
||||
{* Smarty *}
|
||||
|
||||
{load_ticker symbol="YHOO" assign="ticker"}
|
||||
|
||||
Stock Name: {$ticker.name} Stock Price: {$ticker.price}
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</sect1>
|
||||
<sect1 id="tips.obfuscating.email">
|
||||
<title>Ofuscando direcciones de E-mail</title>
|
||||
<para>
|
||||
Usted desea saber como su direccion de E-mail consigue entrar en
|
||||
tantas listas de e-mail de spam? Una direccion unica spammers
|
||||
recolecta direcciones de E-mail y de paginas web. Para ayudar a
|
||||
combatir este problema, usted puede hacer que su direccion de
|
||||
E-mail aparesca en javascript mostrado en el codigo HTML, este
|
||||
mismo aparecera y funcionara correctamente en el navegador.
|
||||
Esto se puede hacer con el plugin mailto.
|
||||
</para>
|
||||
<example>
|
||||
<title>Ejemplo de ofuscamiento de una direccion de E-mail</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
index.tpl
|
||||
---------
|
||||
|
||||
Send inquiries to
|
||||
{mailto address=$EmailAddress encode="javascript" subject="Hello"}
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<note>
|
||||
<title>Nota T<>cnica</title>
|
||||
<para>
|
||||
Este metodo no es 100% a pueba de fallas. Un spammer podr<64>a crear
|
||||
un programa para recolectar el e-mail y para decodificar estos
|
||||
valores, mas no es muy com<6F>n.
|
||||
</para>
|
||||
</note>
|
||||
</sect1>
|
||||
</chapter>
|
||||
<!-- 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
|
||||
-->
|
78
docs/es/appendixes/troubleshooting.xml
Normal file
78
docs/es/appendixes/troubleshooting.xml
Normal file
@@ -0,0 +1,78 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<chapter id="troubleshooting">
|
||||
<title>Localizaci<EFBFBD>n de Errores</title>
|
||||
<para></para>
|
||||
<sect1 id="smarty.php.errors">
|
||||
<title>Errores Smarty/PHP</title>
|
||||
<para>
|
||||
El Smarty puede obtener muchos errores tales como, atributos de
|
||||
etiquetas perdidos o nombres de variables mal formadas. Si este
|
||||
ocurre, Usted vera un error similar al siguiente:
|
||||
</para>
|
||||
<example>
|
||||
<title>Errores de Smarty</title>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Warning: Smarty: [in index.tpl line 4]: syntax error: unknown tag - '%blah'
|
||||
in /path/to/smarty/Smarty.class.php on line 1041
|
||||
|
||||
Fatal error: Smarty: [in index.tpl line 28]: syntax error: missing section name
|
||||
in /path/to/smarty/Smarty.class.php on line 1041
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
<para>
|
||||
Smarty te mostra el nombre del template, el n<>mero de la linea y
|
||||
el error. Despu<70>s de esto, el error consiste en el n<>mero de la
|
||||
linea de la clase Smarty donde ocurrio el error.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Existen ciertos errores que el Smarty no puede entender,
|
||||
tales como un etiqueta de cierre errado. Estos tipos de
|
||||
erros normalmente termina en una interpretacion de error
|
||||
del tiempo de compilacion de PHP.
|
||||
</para>
|
||||
|
||||
<example>
|
||||
<title>Errores de analisis gramatical de PHP</title>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Parse error: parse error in /path/to/smarty/templates_c/index.tpl.php on line 75
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
|
||||
<para>
|
||||
Cuando usted encuentra un error de analisis de PHP, el n<>mero de la
|
||||
linea de error corresponde al script PHP compilado, no al template
|
||||
en si. Normalmente usted puede en el template localizar el error de
|
||||
sinxis. Algunas cosas que usted puede buscar: falta de cierre de
|
||||
etiquetas para {if}{/if} o {section}{/section}, o sintaxis de la
|
||||
l<>gica dentro de una etiqueta {if}. Si usted no encuentra el error,
|
||||
usted tendra que abrir el archivo PHP compilado y dirigirse al n<>mero
|
||||
de linea mostrado, donde el correspondiente error esta en el template.
|
||||
</para>
|
||||
</sect1>
|
||||
</chapter>
|
||||
<!-- 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
|
||||
-->
|
43
docs/es/bookinfo.xml
Executable file
43
docs/es/bookinfo.xml
Executable file
@@ -0,0 +1,43 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<bookinfo id="bookinfo">
|
||||
<title>Smarty - El motor compilador de Plantillas para PHP</title>
|
||||
<authorgroup id="authors">
|
||||
<author>
|
||||
<firstname>Monte</firstname><surname>Ohrt <monte@ispi.net></surname>
|
||||
</author>
|
||||
<author>
|
||||
<firstname>Andrei</firstname><surname>Zmievski <andrei@php.net></surname>
|
||||
</author>
|
||||
<author>
|
||||
<firstname>Mario</firstname><surname>Ram<EFBFBD>rez
|
||||
<mario_ramirez@fjcorona.com.mx></surname>
|
||||
</author>
|
||||
</authorgroup>
|
||||
<pubdate>&build-date;</pubdate>
|
||||
<copyright>
|
||||
<year>2001-2004</year>
|
||||
<holder>ispi of Lincoln, Inc.</holder>
|
||||
</copyright>
|
||||
</bookinfo>
|
||||
|
||||
<!-- 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
|
||||
-->
|
61
docs/es/designers/chapter-debugging-console.xml
Normal file
61
docs/es/designers/chapter-debugging-console.xml
Normal file
@@ -0,0 +1,61 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<chapter id="chapter.debugging.console">
|
||||
<title>Debugging Console</title>
|
||||
<para>
|
||||
Incluso en Smarty existe una consola para debug. La consola informa
|
||||
a usted de todos los templates incluidos, las variables definidas y
|
||||
las variables de archivos de configuraci<63>n de la llamada actual del
|
||||
template. Incluso un template llamado "debug.tpl" viene con la
|
||||
distribuci<63>n de Smarty el cual controla el formateo de la consola.
|
||||
Defina $debugging en true en el Smarty, y si es necesario defina
|
||||
$debug_tpl para la ruta del recurso debug.tpl (Esto es SMARTY_DIR por
|
||||
default). Cuando usted carga una pagina, una consola en javascript
|
||||
abrira una ventana popup y dara a usted el nombre de todos los templates
|
||||
incluidos y las variables definidas en la pagina actual. Para ver las
|
||||
variables disponibles para un template en particular, vea la funci<63>n
|
||||
<link linkend="language.function.debug">{debug}</link>. Para desabilitar
|
||||
la consola del debug, defina $debugging en false. Usted puede activar
|
||||
temporalmente la consola del debug colocando SMARTY_DEBUG en la URL si
|
||||
usted activo esta opci<63>n con
|
||||
<link linkend="variable.debugging.ctrl">$debugging_ctrl</link>.
|
||||
</para>
|
||||
<note>
|
||||
<title>Nota T<>cnica</title>
|
||||
<para>
|
||||
La consola de debug no funciona cuando usted usa la API fetch(), solo
|
||||
cuando estuviera usando display(). Es un conjunto de comandos javascript
|
||||
adicionados al final del template generado. Si a usted no le gusta el
|
||||
javascript, usted puede editar el template debug.tpl para formatear la
|
||||
salida como usted quiera. Los datos del debug no son guardados en cache
|
||||
y los datos del debug.tpl no son incluidos en la consola debug.
|
||||
</para>
|
||||
</note>
|
||||
<note>
|
||||
<para>
|
||||
Los tiempos de carga de cada template y de archivos de configuraci<63>n
|
||||
son en segundos, o en fracciones de segundo.
|
||||
</para>
|
||||
</note>
|
||||
</chapter>
|
||||
|
||||
<!-- 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
|
||||
-->
|
99
docs/es/designers/config-files.xml
Normal file
99
docs/es/designers/config-files.xml
Normal file
@@ -0,0 +1,99 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<chapter id="config.files">
|
||||
<title>Config Files</title>
|
||||
<para>
|
||||
Los archivos de configuraci<63>n son utiles para dise<73>ar y administrar
|
||||
variables globales para los templates a partir de un archivo.
|
||||
Un ejemplo son los colores del template. Normalmente si usted quiere
|
||||
cambiar el esquema de colores de una aplicaci<63>n, usted debe ir a cada
|
||||
uno de los archivos del template y cambiar los colores.
|
||||
Con un archivo de configuraci<63>n, los colores pueden estar mantenidos
|
||||
en un lugar y solo necesita actualizar este para cambiar los colores.
|
||||
</para>
|
||||
<example>
|
||||
<title>Ejemplo de sintaxis de un archivo de configuraci<63>n</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
# global variables
|
||||
pageTitle = "Main Menu"
|
||||
bodyBgColor = #000000
|
||||
tableBgColor = #000000
|
||||
rowBgColor = #00ff00
|
||||
|
||||
[Customer]
|
||||
pageTitle = "Customer Info"
|
||||
|
||||
[Login]
|
||||
pageTitle = "Login"
|
||||
focus = "username"
|
||||
Intro = """This is a value that spans more
|
||||
than one line. you must enclose
|
||||
it in triple quotes."""
|
||||
|
||||
# hidden section
|
||||
[.Database]
|
||||
host=my.domain.com
|
||||
db=ADDRESSBOOK
|
||||
user=php-user
|
||||
pass=foobar
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Los valores de las variables pueden estar entre comillas, mas no es
|
||||
necesario. Usted puede usar comillas simples o dobles. Si usted
|
||||
tuviera un valor que ocupe mas de una linea, coloque todo el valor
|
||||
entre tres comillas ("""). Usted puede colocar comentarios en un
|
||||
archivo de configuraci<63>n con cualquier sintaxis que no sea valida
|
||||
en un archivo de configuraci<63>n. Nosotros recomendamos usar un
|
||||
<literal>#</literal> en el princio de cada linea.
|
||||
</para>
|
||||
<para>
|
||||
Este archivo de configuraci<63>n tiene dos secciones. Los nombres de
|
||||
secciones debe estar entre corchetes []. Los nombres de secci<63>n
|
||||
pueden ser cadenas arbitrarias que no contengan los simbolos
|
||||
<literal>[</literal> or <literal>]</literal>. Las cuatro variables
|
||||
en la cabecera son variables globales, o no son variables de secci<63>n.
|
||||
Estas variables son siempre cargadas del archivo de configuraci<63>n. Si
|
||||
una secci<63>n en particular fuera cargada, entonces las variables
|
||||
globales y las variables de esta secci<63>n son cargadas. Si una variable
|
||||
existe como global y dentro de una secci<63>n, la variable de secci<63>n
|
||||
ser<65> utilizada. Si usted tuviera dos variables en la misma secci<63>n con
|
||||
el mismo nombre, la ultima ser<65> utilizada.
|
||||
</para>
|
||||
<para>
|
||||
Los archivos de configuraci<63>n son cargados en el template con una
|
||||
funci<63>n incrustada <command>config_load</command>.
|
||||
</para>
|
||||
<para>
|
||||
Usted puede esconder variables o secciones enteras colocando un punto
|
||||
antes del nombre de la variable. Esto es <20>til si su aplicaci<63>n lee los
|
||||
archivos de configuraci<63>n y los datos sensibles a partir de ellos que
|
||||
la herramienta del template no lo necesita. Si usted tiene a otras
|
||||
personas realizando la edici<63>n de templates, usted tendra la certesa
|
||||
que ellos no leeran datos sensibles del archivo de configuraci<63>n
|
||||
cargando estos en el template.
|
||||
</para>
|
||||
</chapter>
|
||||
|
||||
<!-- 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
|
||||
-->
|
45
docs/es/designers/language-basic-syntax.xml
Normal file
45
docs/es/designers/language-basic-syntax.xml
Normal file
@@ -0,0 +1,45 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<chapter id="language.basic.syntax">
|
||||
<title>Basic Syntax</title>
|
||||
<para>
|
||||
Todas las etiquetas del template deben estar marcadas por delimitadores.
|
||||
Por default , estos delimitadores son <literal>{</literal>
|
||||
y <literal>}</literal>, sino estos pueden cambiar.
|
||||
</para>
|
||||
<para>
|
||||
Para estos ejemplos, nosotros asumiremos que usted est<73> usando los
|
||||
delimitadores por default. En Smarty, todo el contenido fuera de los
|
||||
delimitadores es mostrado como contenido estatico, o igual(sin cambios).
|
||||
Cuando Smarty encuentra etiquetas en el template, trata de interpretarlos,
|
||||
e intenta mostrar la salida apropiada en su lugar.
|
||||
</para>
|
||||
|
||||
&designers.language-basic-syntax.language-syntax-comments;
|
||||
&designers.language-basic-syntax.language-syntax-functions;
|
||||
&designers.language-basic-syntax.language-syntax-attributes;
|
||||
&designers.language-basic-syntax.language-syntax-quotes;
|
||||
&designers.language-basic-syntax.language-math;
|
||||
&designers.language-basic-syntax.language-escaping;
|
||||
|
||||
</chapter>
|
||||
<!-- 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
|
||||
-->
|
@@ -0,0 +1,83 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.escaping">
|
||||
<title>Escaping Smarty Parsing</title>
|
||||
<para>
|
||||
It is sometimes desirable or even necessary to have Smarty ignore sections it
|
||||
would otherwise parse. A classic example is embedding Javascript or CSS code in
|
||||
a template. The problem arises as those languages use the { and } characters
|
||||
which are also the default delimiters for Smarty.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The simplest thing is to avoid the situation altogether by separating your Javascript
|
||||
and CSS code into their own files and then using standard HTML methods to access them.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Including literal content is possible using <link
|
||||
linkend="language.function.literal">{literal} .. {/literal}</link> blocks.
|
||||
Similar to HTML entity usage, you can use <link
|
||||
linkend="language.function.ldelim">{ldelim}</link>,<link
|
||||
linkend="language.function.ldelim">{rdelim}</link> or <link
|
||||
linkend="language.variables.smarty.ldelim">{$smarty.ldelim}</link>,<link
|
||||
linkend="language.variables.smarty.rdelim">{$smarty.rdelim}</link>
|
||||
to display the current delimiters.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
It is often convenient to simply change Smarty's <link
|
||||
linkend="variable.left.delimiter">$left_delimiter</link> and
|
||||
<link linkend="variable.right.delimiter">$right_delimiter</link>.
|
||||
</para>
|
||||
<example>
|
||||
<title>changing delimiters example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$smarty = new Smarty;
|
||||
$smarty->left_delimiter = '<!--{';
|
||||
$smarty->right_delimiter = '}-->';
|
||||
$smarty->assign('foo', 'bar');
|
||||
$smarty->display('example.tpl');
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Where example.tpl is:
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
<script language="javascript">
|
||||
var foo = <!--{$foo}-->;
|
||||
function dosomething() {
|
||||
alert("foo is " + foo);
|
||||
}
|
||||
dosomething();
|
||||
</script>
|
||||
]]>
|
||||
</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
|
||||
-->
|
49
docs/es/designers/language-basic-syntax/language-math.xml
Normal file
49
docs/es/designers/language-basic-syntax/language-math.xml
Normal file
@@ -0,0 +1,49 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.math">
|
||||
<title>Matem<EFBFBD>ticas</title>
|
||||
<para>
|
||||
Las matem<65>ticas pueden ser aplicadas directamente al los valores de
|
||||
las variables.
|
||||
</para>
|
||||
<example>
|
||||
<title>Ejemplos de matem<65>ticas</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{$foo+1}
|
||||
|
||||
{$foo*$bar}
|
||||
|
||||
{* some more complicated examples *}
|
||||
|
||||
{$foo->bar-$bar[1]*$baz->foo->bar()-3*7}
|
||||
|
||||
{if ($foo+$bar.test%$baz*134232+10+$b+10)}
|
||||
|
||||
{$foo|truncate:"`$fooTruncCount/$barTruncFactor-1`"}
|
||||
|
||||
{assign var="foo" value="`$foo+$bar`"}
|
||||
]]>
|
||||
</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
|
||||
-->
|
@@ -0,0 +1,58 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.syntax.attributes">
|
||||
<title>Atributos</title>
|
||||
<para>
|
||||
La mayoria de las funciones llevan atributos que especifican o
|
||||
cambian su funcionamiento. Los atributos para las funciones de
|
||||
Smarty son muy parecidos a los atributos de HTML. Los valores
|
||||
estaticos no necesitan estar entre comillas, pero si es recomendado
|
||||
para cadenas y literales. Las variables tambi<62>n pueden ser usadas
|
||||
y no precisamente estando entre comillas.
|
||||
</para>
|
||||
<para>
|
||||
Algunos atributos requieren valores boleanos(true o false).
|
||||
Estos pueden ser especificados como cualquier otro valor sin comillas
|
||||
<literal>true</literal>, <literal>on</literal>, y
|
||||
<literal>yes</literal>, o <literal>false</literal>,
|
||||
<literal>off</literal>, y <literal>no</literal>.
|
||||
</para>
|
||||
<example>
|
||||
<title>Sintaxis de atributos de Funciones</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{include file="header.tpl"}
|
||||
|
||||
{include file=$includeFile}
|
||||
|
||||
{include file=#includeFile#}
|
||||
|
||||
{html_select_date display_days=yes}
|
||||
|
||||
<select name="company">
|
||||
{html_options values=$vals selected=$selected output=$output}
|
||||
</select>
|
||||
]]>
|
||||
</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
|
||||
-->
|
@@ -0,0 +1,52 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.syntax.comments">
|
||||
<title>Comentarios</title>
|
||||
<para>
|
||||
Los comentarios en los templates son cercados por asteriscos, y por
|
||||
los delimitadores, as<61>:<br> {* este es un comentario *}.
|
||||
Los comentarios en Smarty no son mostrados en la salida final del
|
||||
template.
|
||||
Estos son usados para hacer notas internas dentro del template.
|
||||
</para>
|
||||
<example>
|
||||
<title>Comentarios</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{* Smarty *}
|
||||
|
||||
{* include the header file here *}
|
||||
{include file="header.tpl"}
|
||||
|
||||
{include file=$includeFile}
|
||||
|
||||
{include file=#includeFile#}
|
||||
|
||||
{* display dropdown lists *}
|
||||
<select name="company">
|
||||
{html_options values=$vals selected=$selected output=$output}
|
||||
</select>
|
||||
]]>
|
||||
</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
|
||||
-->
|
@@ -0,0 +1,62 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.syntax.functions">
|
||||
<title>Funciones</title>
|
||||
<para>
|
||||
Cada etiqueta Smarty muestra una
|
||||
<link linkend="language.variables">variable</link> o utiliza alg<6C>n
|
||||
tipo de funci<63>n. Las funciones son procesadas y mostradas colocando
|
||||
los atributos de la funci<63>n entre delimitadores, as<61>:
|
||||
{funcname attr1="val" attr2="val"}.
|
||||
</para>
|
||||
<example>
|
||||
<title>Sintaxis de Funciones</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{config_load file="colors.conf"}
|
||||
|
||||
{include file="header.tpl"}
|
||||
|
||||
{if $highlight_name}
|
||||
Welcome, <font color="{#fontColor#}">{$name}!</font>
|
||||
{else}
|
||||
Welcome, {$name}!
|
||||
{/if}
|
||||
|
||||
{include file="footer.tpl"}
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Las funciones internas y las funciones habituales, ambas deben tener
|
||||
la misma sintaxis dentro del template. Las funciones internas que
|
||||
funcionan en Smarty, son: <command>if</command>,
|
||||
<command>section</command> y <command>strip</command>.
|
||||
Estas no pueden ser modificadas. Las funciones habituales son
|
||||
funciones adicionales implementadas por plugins. Estas si pueden
|
||||
ser modificadas como usted quiera, o usted tambi<62>n puede
|
||||
adicionar nuevas.
|
||||
<command>html_options</command> y <command>html_select_date</command>
|
||||
son ejemplos de funciones habituales.
|
||||
</para>
|
||||
</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
|
||||
-->
|
@@ -0,0 +1,49 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.syntax.quotes">
|
||||
<title>Colocando variables entre comillas dobles</title>
|
||||
<para>
|
||||
Smarty puede reconocer variables asignadas entre comillas aunque estas
|
||||
solo tengan n<>meros, letras, guiones bajos y corchetes[].
|
||||
Con cualquier otro car<61>cter(puntos, referencia de objetos, etc.) las
|
||||
variables deben estar entre apostrofos.
|
||||
</para>
|
||||
<example>
|
||||
<title>Sintaxis entre comillas</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
SYNTAX EXAMPLES:
|
||||
{func var="test $foo test"} <-- sees $foo
|
||||
{func var="test $foo_bar test"} <-- sees $foo_bar
|
||||
{func var="test $foo[0] test"} <-- sees $foo[0]
|
||||
{func var="test $foo[bar] test"} <-- sees $foo[bar]
|
||||
{func var="test $foo.bar test"} <-- sees $foo (not $foo.bar)
|
||||
{func var="test `$foo.bar` test"} <-- sees $foo.bar
|
||||
|
||||
PRACTICAL EXAMPLES:
|
||||
{include file="subdir/$tpl_name.tpl"} <-- will replace $tpl_name with value
|
||||
{cycle values="one,two,`$smarty.config.myval`"} <-- must have backticks
|
||||
]]>
|
||||
</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
|
||||
-->
|
45
docs/es/designers/language-builtin-functions.xml
Normal file
45
docs/es/designers/language-builtin-functions.xml
Normal file
@@ -0,0 +1,45 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<chapter id="language.builtin.functions">
|
||||
<title>Funciones Integradas</title>
|
||||
<para>
|
||||
Smarty cuenta con varias funciones integradas. Las funciones Integradas
|
||||
forman parte del lenguaje del template. Usted no puede crear funciones
|
||||
personalizadas con el mismo nombre, ni puede modificar las funciones
|
||||
integradas.
|
||||
</para>
|
||||
|
||||
&designers.language-builtin-functions.language-function-capture;
|
||||
&designers.language-builtin-functions.language-function-config-load;
|
||||
&designers.language-builtin-functions.language-function-foreach;
|
||||
&designers.language-builtin-functions.language-function-include;
|
||||
&designers.language-builtin-functions.language-function-include-php;
|
||||
&designers.language-builtin-functions.language-function-insert;
|
||||
&designers.language-builtin-functions.language-function-if;
|
||||
&designers.language-builtin-functions.language-function-ldelim;
|
||||
&designers.language-builtin-functions.language-function-literal;
|
||||
&designers.language-builtin-functions.language-function-php;
|
||||
&designers.language-builtin-functions.language-function-section;
|
||||
&designers.language-builtin-functions.language-function-strip;
|
||||
|
||||
</chapter>
|
||||
<!-- 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
|
||||
-->
|
@@ -0,0 +1,110 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.function.capture">
|
||||
<title>capture</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>name</entry>
|
||||
<entry>string</entry>
|
||||
<entry>no</entry>
|
||||
<entry><emphasis>default</emphasis></entry>
|
||||
<entry>El nombre del bloque capturado</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>assign</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>El nombre de la variable para dar valor a la salida
|
||||
capturada</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
capture es usado para recolectar toda la salida del template en una
|
||||
variable en lugar de mostrarla.
|
||||
Cualquier contenido entre {capture name="foo"} y {/capture} es
|
||||
recoletado en una variable especificada y el atributo name. El
|
||||
contenido capturado puede ser usado en el template a partir de la
|
||||
variable especial $smarty.capture.foo en donde foo es el valor
|
||||
pasado para el atributo name. Si usted no pasa un atributo name,
|
||||
entonces ser<65> usado "default". Todos lo comandos {capture} deben
|
||||
estar entre {/capture}. Usted puede anidar(colocar uno dentro de
|
||||
otro) comandos capture.
|
||||
</para>
|
||||
<note>
|
||||
<title>Nota Tecnica</title>
|
||||
<para>
|
||||
Smarty 1.4.0 - 1.4.4 coloca el contenido capturado dentro de la
|
||||
variable llamada $return. A partir de 1.4.5, este funcionamento fue
|
||||
cambiado para usar el atributo name, entonces en consecuencia actualice
|
||||
sus templates.
|
||||
</para>
|
||||
</note>
|
||||
<caution>
|
||||
<para>
|
||||
Tenga cuidado cuando capture la salida del comando
|
||||
<command>insert</command>. Si tuviera activo el cache y tuviera
|
||||
comandos <command>insert</command> y usted espera que funcione
|
||||
con contenido de cache, no se capturara este contenido.
|
||||
</para>
|
||||
</caution>
|
||||
<para>
|
||||
<example>
|
||||
<title>capturando contenido de template</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{* no queremos imprimir la fila de la tabla a menos que exista
|
||||
contenido para desplegar *}
|
||||
{capture name=banner}
|
||||
{include file="get_banner.tpl"}
|
||||
{/capture}
|
||||
{if $smarty.capture.banner ne ""}
|
||||
<tr>
|
||||
<td>
|
||||
{$smarty.capture.banner}
|
||||
</td>
|
||||
</tr>
|
||||
{/if}
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
</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
|
||||
-->
|
@@ -0,0 +1,148 @@
|
||||
<?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
|
||||
-->
|
@@ -0,0 +1,195 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.function.foreach">
|
||||
<title>foreach,foreachelse</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>from</entry>
|
||||
<entry>array</entry>
|
||||
<entry>Si</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>El nombre de la matriz a la que usted estara pegando
|
||||
los elementos</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>item</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Si</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>El nombre de la variable que es el elemento
|
||||
actual</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>key</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>El nombre de la variable que es la llave actual</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>name</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>El nombre del ciclo foreach para acessar a las propiedades del foreach</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
Los ciclos(loop) <emphasis>foreach</emphasis> son una alternativa para loop
|
||||
<emphasis>section</emphasis>. <emphasis>foreach</emphasis> es usado para pegar
|
||||
cada elemento de una matriz asociativa simple.
|
||||
La sintaxis para <emphasis>foreach</emphasis> es mucho mas simple que
|
||||
<emphasis>section</emphasis>, pero tiene una desventaja de que solo puede ser
|
||||
usada en una <20>nica matriz.
|
||||
La etiqueta <emphasis>foreach</emphasis> debe tener su par
|
||||
<emphasis>/foreach</emphasis>.
|
||||
Los par<61>metros requeridos son <emphasis>from</emphasis> e
|
||||
<emphasis>item</emphasis>. El nombre del ciclo(loop) foreach puede ser
|
||||
cualquier cosa que usted quiera, hecho de letras, n<>meros y subrayados.
|
||||
Los ciclos(loop) <emphasis>foreach</emphasis> pueden ser anidados,
|
||||
y el nombre de los ciclos(loop) anidados debe ser diferente uno de
|
||||
otro. La variable <emphasis>from</emphasis> (normalmente una matriz de valores)
|
||||
determina el n<>mero de veces del ciclo(loop) <emphasis>foreach</emphasis>.
|
||||
<emphasis>foreachelse</emphasis> y ejecutando cuando no hubieren mas valores
|
||||
en la variable <emphasis>from</emphasis>.
|
||||
</para>
|
||||
<example>
|
||||
<title>foreach</title>
|
||||
<programlisting>
|
||||
|
||||
{* este ejemplo muestra todos los valores de la matriz $custid *}
|
||||
{foreach from=$custid item=curr_id}
|
||||
id: {$curr_id}<br>
|
||||
{/foreach}
|
||||
|
||||
SALIDA:
|
||||
|
||||
id: 1000<br>
|
||||
id: 1001<br>
|
||||
id: 1002<br></programlisting>
|
||||
</example>
|
||||
|
||||
<example>
|
||||
<title>foreach key</title>
|
||||
<programlisting>
|
||||
{* La llave contiene la llave para cada valor del ciclo(loop)
|
||||
|
||||
asignacion fisica de esta manera:
|
||||
|
||||
$smarty->assign("contacts", array(array("phone" => "1", "fax" => "2", "cell" => "3"),
|
||||
array("phone" => "555-4444", "fax" => "555-3333", "cell" => "760-1234")));
|
||||
|
||||
*}
|
||||
|
||||
{foreach name=outer item=contact from=$contacts}
|
||||
{foreach key=key item=item from=$contact}
|
||||
{$key}: {$item}<br>
|
||||
{/foreach}
|
||||
{/foreach}
|
||||
|
||||
SALIDA:
|
||||
|
||||
phone: 1<br>
|
||||
fax: 2<br>
|
||||
cell: 3<br>
|
||||
phone: 555-4444<br>
|
||||
fax: 555-3333<br>
|
||||
cell: 760-1234<br></programlisting>
|
||||
</example>
|
||||
|
||||
<para>
|
||||
El ciclo(Loop) foreach tambi<62>n tiene sus propias variables para
|
||||
manipular las propiedades del foreach.
|
||||
Estas son indicadas as<61>: {$smarty.foreach.foreachname.varname} con
|
||||
foreachname siendo el nombre especificado del atributo
|
||||
<emphasis>name</emphasis> del foreach.
|
||||
</para>
|
||||
|
||||
|
||||
<sect2 id="foreach.property.iteration">
|
||||
<title>iteration</title>
|
||||
<para>
|
||||
iteration es usado para mostrar la interaci<63>n actual del ciclo(loop).
|
||||
</para>
|
||||
<para>
|
||||
iteration siempre comienza en 1 incrementado uno a uno en cada interaci<63>nn.
|
||||
</para>
|
||||
</sect2>
|
||||
|
||||
<sect2 id="foreach.property.first">
|
||||
<title>first</title>
|
||||
<para>
|
||||
<emphasis>first</emphasis> Toma el valor true si la interaci<63>n actual del
|
||||
foreach es la primera.
|
||||
</para>
|
||||
</sect2>
|
||||
|
||||
<sect2 id="foreach.property.last">
|
||||
<title>last</title>
|
||||
<para>
|
||||
<emphasis>last</emphasis> Toma el valor de true si la interaci<63>n actual
|
||||
del foreach es la ultima.
|
||||
</para>
|
||||
</sect2>
|
||||
|
||||
<sect2 id="foreach.property.show">
|
||||
<title>show</title>
|
||||
<para>
|
||||
<emphasis>show</emphasis> Es usado como par<61>metro para el foreach.
|
||||
<emphasis>show</emphasis> Es un valor booleano, true o false.
|
||||
Si es false, el foreach no ser<65> mostrado. Si tuviera un
|
||||
foreachelse presente, este ser<65> alternativamente mostrado.
|
||||
</para>
|
||||
|
||||
</sect2>
|
||||
<sect2 id="foreach.property.total">
|
||||
<title>total</title>
|
||||
<para>
|
||||
<emphasis>total</emphasis> Es usado para mostrar el n<>mero de interaciones
|
||||
del foreach. Este puede ser usado dentro o despu<70>s de el.
|
||||
</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
|
||||
-->
|
@@ -0,0 +1,219 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.function.if">
|
||||
<title>if,elseif,else</title>
|
||||
<para>
|
||||
Los comandos if del Smarty tiene mucho de la flexibilidad del comando
|
||||
if de php, con algunas adiciones para la herramienta de template.
|
||||
Todo <emphasis>{if}</emphasis> debe tener su <emphasis>{/if}</emphasis>.
|
||||
<emphasis>{else}</emphasis> y <emphasis>{elseif}</emphasis> tambien son
|
||||
permitidos.
|
||||
Toda las condicionales de PHP son reconcidas, tal como
|
||||
<emphasis>||</emphasis>, <emphasis>or</emphasis>,
|
||||
<emphasis>&&</emphasis>, <emphasis>and</emphasis>, etc.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
La siguiente es una lista de calificadores reconocidos, los cuales
|
||||
deberan estar separados los dos elementos por espacios.
|
||||
Nota loas articulos pueden listarse [entre corchetes] es opcional.
|
||||
Equivalentes al lugar donde se apliquen en PHP.
|
||||
</para>
|
||||
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="4">
|
||||
<colspec colname="qualifier" align="center" />
|
||||
<colspec colname="alternates" align="center" />
|
||||
<colspec colname="meaning" />
|
||||
<colspec colname="example" />
|
||||
<colspec colname="php" />
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Calificador</entry>
|
||||
<entry>Alternativa</entry>
|
||||
<entry>Ejemplo de Sintaxis</entry>
|
||||
<entry>Significado</entry>
|
||||
<entry>Equivalente en PHP</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>==</entry>
|
||||
<entry>eq</entry>
|
||||
<entry>$a eq $b</entry>
|
||||
<entry>Iguales</entry>
|
||||
<entry>==</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>!=</entry>
|
||||
<entry>ne, neq</entry>
|
||||
<entry>$a neq $b</entry>
|
||||
<entry>Diferentes</entry>
|
||||
<entry>!=</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>></entry>
|
||||
<entry>gt</entry>
|
||||
<entry>$a gt $b</entry>
|
||||
<entry>Mayor que</entry>
|
||||
<entry>></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><</entry>
|
||||
<entry>lt</entry>
|
||||
<entry>$a lt $b</entry>
|
||||
<entry>menor que</entry>
|
||||
<entry><</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>>=</entry>
|
||||
<entry>gte, ge</entry>
|
||||
<entry>$a ge $b</entry>
|
||||
<entry>mayor que o igual</entry>
|
||||
<entry>>=</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><=</entry>
|
||||
<entry>lte, le</entry>
|
||||
<entry>$a le $b</entry>
|
||||
<entry>menor que o igual</entry>
|
||||
<entry><=</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>!</entry>
|
||||
<entry>not</entry>
|
||||
<entry>not $a</entry>
|
||||
<entry>negaci<EFBFBD>n (unary)</entry>
|
||||
<entry>!</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>%</entry>
|
||||
<entry>mod</entry>
|
||||
<entry>$a mod $b</entry>
|
||||
<entry>modulo</entry>
|
||||
<entry>%</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>is [not] div by</entry>
|
||||
<entry></entry>
|
||||
<entry>$a is not div by 4</entry>
|
||||
<entry>divisible por</entry>
|
||||
<entry>$a % $b == 0</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>is [not] even</entry>
|
||||
<entry></entry>
|
||||
<entry>$a is not even</entry>
|
||||
<entry>[not] es numero par (unary)</entry>
|
||||
<entry>$a % 2 == 0</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>is [not] even by</entry>
|
||||
<entry></entry>
|
||||
<entry>$a is not even by $b</entry>
|
||||
<entry>agrupar niveles pares [not]</entry>
|
||||
<entry>($a / $b) % 2 == 0</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>is [not] odd</entry>
|
||||
<entry></entry>
|
||||
<entry>$a is not odd</entry>
|
||||
<entry>[not] el numero es impar (unary)</entry>
|
||||
<entry>$a % 2 != 0</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>is [not] odd by</entry>
|
||||
<entry></entry>
|
||||
<entry>$a is not odd by $b</entry>
|
||||
<entry>[not] agrupa los niveles impares</entry>
|
||||
<entry>($a / $b) % 2 != 0</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<example>
|
||||
<title>sentencia if</title>
|
||||
<programlisting>
|
||||
{if $name eq "Fred"}
|
||||
Welcome Sir.
|
||||
{elseif $name eq "Wilma"}
|
||||
Welcome Ma'am.
|
||||
{else}
|
||||
Welcome, whatever you are.
|
||||
{/if}
|
||||
|
||||
{* Un ejemplo con "or" logico *}
|
||||
{if $name eq "Fred" or $name eq "Wilma"}
|
||||
...
|
||||
{/if}
|
||||
|
||||
{* El mismo que arriba *}
|
||||
{if $name == "Fred" || $name == "Wilma"}
|
||||
...
|
||||
{/if}
|
||||
|
||||
{* La siguiente sintaxis no funcionara, el calificador de condici<63>n
|
||||
deben estar separados entre ellos por espacios *}
|
||||
{if $name=="Fred" || $name=="Wilma"}
|
||||
...
|
||||
{/if}
|
||||
|
||||
|
||||
{* los parentesis son permitidos *}
|
||||
{if ( $amount < 0 or $amount > 1000 ) and $volume >= #minVolAmt#}
|
||||
...
|
||||
{/if}
|
||||
|
||||
{* Usted tambi<62>n puede colocar funciones de PHP *}
|
||||
{if count($var) gt 0}
|
||||
...
|
||||
{/if}
|
||||
|
||||
{* checa si el valor es par o impar *}
|
||||
{if $var is even}
|
||||
...
|
||||
{/if}
|
||||
{if $var is odd}
|
||||
...
|
||||
{/if}
|
||||
{if $var is not odd}
|
||||
...
|
||||
{/if}
|
||||
|
||||
{* checa si la variable var es divisible por 4 *}
|
||||
{if $var is div by 4}
|
||||
...
|
||||
{/if}
|
||||
|
||||
{* Checa si la variable var es igual, agrupandola por dos. i.e.,
|
||||
0=even, 1=even, 2=odd, 3=odd, 4=even, 5=even, etc. *}
|
||||
{if $var is even by 2}
|
||||
...
|
||||
{/if}
|
||||
|
||||
{* 0=even, 1=even, 2=even, 3=odd, 4=odd, 5=odd, etc. *}
|
||||
{if $var is even by 3}
|
||||
...
|
||||
{/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
|
||||
-->
|
@@ -0,0 +1,142 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.function.include.php">
|
||||
<title>include_php</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 php a incluir</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>once</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>true</emphasis></entry>
|
||||
<entry>Cuando incluir o no el archivo php mas de una vez,
|
||||
ser incluido varias veces</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>assign</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>El nombre de la variable que recibir<69> la
|
||||
salida del archivo php</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<note>
|
||||
<title>Nota t<>cnica</title>
|
||||
<para>
|
||||
include_php es muy desaprovechado desde Smarty, usted puede
|
||||
lograr la misma funcionalidad por medio de las funciones de
|
||||
costumbre del template.
|
||||
La unica raz<61>n para usar include_php es si usted en realidad tiene
|
||||
la necesidad de poner en cuarentna la funcion de php fuera del
|
||||
directorio de plugin y su codigo de la aplicaci<63>n.
|
||||
Vea un <link linkend="tips.componentized.templates">ejemplo</link>
|
||||
de templates componentizados para detalles.
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
Las etiquetas include_php son usadas para incluir un script PHP
|
||||
dentro de su template. Si la seguridad estuviera activada, entonces
|
||||
el script PHP debe estar localizado en la ruta $trusted_dir.
|
||||
La etiqueta include_php debe tener el atributo "file", el cual
|
||||
contiene la ruta del archivo PHP a ser incluido, o el relativo
|
||||
al $trusted_dir, o una ruta absoluta.
|
||||
</para>
|
||||
<para>
|
||||
include_php es un buen medio para manipular templates con componentes,
|
||||
y mantiene el c<>digo PHP separado de los archivos del template.
|
||||
Vamos adecir que usted tenga un template que muestre la navegaci<63>n de
|
||||
su sitio, el cual es tirado autom<6F>ticamente a partir de una base de
|
||||
datos. Usted puede mantener su l<>gica de PHP que obtiene los datos en
|
||||
un directorio separado, e incluirla arriba del template. Ahora usted
|
||||
puede incluir este template en cualquier lugar sin preocuparse si la
|
||||
informaci<63>n de la base de datos fue obtenida por la aplicaci<63>n antes
|
||||
de usarla.
|
||||
</para>
|
||||
<para>
|
||||
Por default, los archivos son incluidos solo una vez a un cuando son
|
||||
incluidos varias veces en el template. Usted puede especificar que este
|
||||
sea incluido todas la veces con un atributo <emphasis>once</emphasis>.
|
||||
Definindo como false incluira el script php cada vez que este sea
|
||||
incluido en el template.
|
||||
</para>
|
||||
<para>
|
||||
Usted puede opcionalmente pasar el atributo <emphasis>assign</emphasis>,
|
||||
el cual especificara una variable del template la cual contendra toda la
|
||||
salida del <emphasis>include_php</emphasis> en vez de mostrarla.
|
||||
</para>
|
||||
<para>
|
||||
El objeto smarty esta disponible como $this dentro del script php que usted
|
||||
incluyo.
|
||||
</para>
|
||||
<example>
|
||||
<title>funcion include_php</title>
|
||||
<programlisting>
|
||||
load_nav.php
|
||||
-------------
|
||||
|
||||
<?php
|
||||
|
||||
// carga variables de una base de datos mysql y def<65>ne esta para el template
|
||||
require_once("MySQL.class.php");
|
||||
$sql = new MySQL;
|
||||
$sql->query("select * from site_nav_sections order by name",SQL_ALL);
|
||||
$this->assign('sections',$sql->record);
|
||||
|
||||
?>
|
||||
|
||||
|
||||
index.tpl
|
||||
---------
|
||||
{* ruta absoluta o relativa del $trusted_dir *}
|
||||
{include_php file="/path/to/load_nav.php"}
|
||||
|
||||
{foreach item="curr_section" from=$sections}
|
||||
<a href="{$curr_section.url}">{$curr_section.name}</a><br>
|
||||
{/foreach}</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
|
||||
-->
|
@@ -0,0 +1,123 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.function.include">
|
||||
<title>include</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 template a Incluir.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>assign</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>El nombre de una variable que contendra toda la
|
||||
salida del template.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>[var ...]</entry>
|
||||
<entry>[var type]</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Variable para pasar localmente a el template</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
Las etiquetas include son usadas para incluir otros templates en
|
||||
el template actual. Cualquier variable disponible en el template
|
||||
actual, tambi<62>n esta disponible dentro del template incluido.
|
||||
La etiqueta include debe tener el atributo "file", el cual contiene
|
||||
la ruta del archivo a incluir.
|
||||
</para>
|
||||
<para>
|
||||
Usted puede opcionalmente pasar el atributo <emphasis>assign</emphasis>,
|
||||
el cual especificara el nombre de una variable de template para el cual
|
||||
contendra toda la salida de <emphasis>include</emphasis> en vez de mostrarla.
|
||||
</para>
|
||||
<example>
|
||||
<title>funcion include</title>
|
||||
<programlisting>
|
||||
{include file="header.tpl"}
|
||||
|
||||
{* el cuerpo del template va aqui *}
|
||||
|
||||
{include file="footer.tpl"}</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Usted tambi<62>n puede pasar variables al template incluidas como
|
||||
atributos. Cualquier variable pasada al template incluidas como
|
||||
atributos estan disponibles solamente dentro el espacio del template.
|
||||
Las variables pasadas como atributos sobreescriben a las variables
|
||||
del template actual, en el caso en el que estas tengan el mismo nombre.
|
||||
</para>
|
||||
<example>
|
||||
<title>Funci<EFBFBD>n include pasando variables</title>
|
||||
<programlisting>
|
||||
{include file="header.tpl" title="Main Menu" table_bgcolor="#c0c0c0"}
|
||||
|
||||
{* el cuerpo del template va aqui *}
|
||||
|
||||
{include file="footer.tpl" logo="http://my.domain.com/logo.gif"}</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Use la sintaxis de <link linkend="template.resources">template resources</link>
|
||||
para incluir archivos fuera del directorio $template_dir.
|
||||
</para>
|
||||
<example>
|
||||
<title>Ejemplos de recursos para la funci<63>n include</title>
|
||||
<programlisting>
|
||||
{* ruta absoluta *}
|
||||
{include file="/usr/local/include/templates/header.tpl"}
|
||||
|
||||
{* ruta absoluta (lo mismo) *}
|
||||
{include file="file:/usr/local/include/templates/header.tpl"}
|
||||
|
||||
{* ruta absoluta de windows (DEBE usar el prefijo "file:") *}
|
||||
{include file="file:C:/www/pub/templates/header.tpl"}
|
||||
|
||||
{* incluir a partir del recurso de template denominado "db" *}
|
||||
{include file="db:header.tpl"}</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
|
||||
-->
|
@@ -0,0 +1,142 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.function.insert">
|
||||
<title>insert</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>name</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Si</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>El nombre de la funci<63>n insert(insert_name)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>assign</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>El nombre de la variable del template que recibir<69> la
|
||||
salida</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>script</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>El nombre de un php que ser<65> incluido antes que la
|
||||
funci<63>n insert sea llamada </entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>[var ...]</entry>
|
||||
<entry>[var type]</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Variable para pasar a la funci<63>n insert</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
La etiqueta funciona parecido a las etiquetas include, excepto
|
||||
que las etiquetas insert no van para el cache cuando
|
||||
<link linkend="caching">caching</link> esta activado.
|
||||
Esta sera executada a cada invocaci<63>n del template.
|
||||
</para>
|
||||
<para>
|
||||
Digamos que usted tiene un template con un banner en la parte de arriba
|
||||
de la pagina. El banner puede contener cualquier mezcla de HTML, imagenes,
|
||||
flash, etc. As<41> nosotros no podemos usar una liga(link) estatica aqu<71>,
|
||||
y nosotros no queremos que este el contenido oculto con la pagina.
|
||||
Aqu<71> vemos la etiqueta insert: el template conoce los valores
|
||||
#banner_location_id# y #site_id# (obtenidos de un archivo de configuraci<63>n),
|
||||
y necesita llamar una funci<63>n para obtener el contenido del banner.
|
||||
</para>
|
||||
<example>
|
||||
<title>funci<EFBFBD>n insert</title>
|
||||
<programlisting>
|
||||
{* ejemplo de traer un banner *}
|
||||
{insert name="getBanner" lid=#banner_location_id# sid=#site_id#}</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
En este ejemplo, nosotros estamos usando el nombre "getBanner"
|
||||
y pasando los par<61>metros #banner_location_id# y #site_id#.
|
||||
El Smarty lo buscara en la funci<63>n llamada insert_getBanner()
|
||||
en su aplicaci<63>n PHP, pasando los valores de #banner_location_id#
|
||||
y #site_id# como primer argumento en una matriz asociativa.
|
||||
Todos los nombres de las funciones insert en su aplicaci<63>n deben
|
||||
ser precedidas por "insert_" para prevenir posibles problemas con
|
||||
nombres de funciones repetidos. Su funci<63>n insert_getBanner() debe
|
||||
hacer algo con los valores pasados y retornar los resultados.
|
||||
Estos resultados son mostrados en el template en lugar de la
|
||||
etiqueta insert. En este ejemplo, el Smarty llamara esta funci<63>n:
|
||||
insert_getBanner(array("lid" => "12345","sid" => "67890")); y
|
||||
mostrara el resultado retornado en el lugar de la etiqueta insert.
|
||||
</para>
|
||||
<para>
|
||||
Si usted proporciona el atributo "assign", la salida de la etiqueta
|
||||
insert ser<65> dada a esta variable en vez de ser una salida en el template.
|
||||
Nota: definir la salida a una variable no es util cuando el cache esta
|
||||
activo.
|
||||
</para>
|
||||
<para>
|
||||
Si usted proporciona el atributo "script", este script php ser<65>
|
||||
incluido (solo una vez) antes de la ejecuci<63>n de la funci<63>n insert.
|
||||
Este es el caso donde la funci<63>n insert no exista todavia, y el
|
||||
script php debe ser incluido antes para que pueda funcionar.
|
||||
La ruta puede ser absuluta o relativa a $trusted_dir.
|
||||
Cuando la seguridad esta activada, el script debe estar en $trusted_dir.
|
||||
</para>
|
||||
<para>
|
||||
El objeto Smarty es pasado como segundo argumento. De este modo
|
||||
puede referenciar y modificar informaci<63>n del objeto Smarty dentro
|
||||
de la funci<63>n.
|
||||
</para>
|
||||
<note>
|
||||
<title>Nota Tecnica</title>
|
||||
<para>
|
||||
Es posible tener partes del template fuera de la cache.
|
||||
Si usted tuviera <link linkend="caching">caching</link>
|
||||
activado, la etiqueta insert no podra heredar por la cache.
|
||||
Esta sera ejecutada din<69>micamente cada vez que la pagina
|
||||
sea creada, igual con paginas en cache. Esto funciona bien
|
||||
para cosas como banners, encuestas, clima, busqueda de
|
||||
resultados, areas de opini<6E>n de usuario, etc.
|
||||
</para>
|
||||
</note>
|
||||
</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
|
||||
-->
|
@@ -0,0 +1,52 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.function.ldelim">
|
||||
<title>ldelim,rdelim</title>
|
||||
<para>
|
||||
ldelim y rdelim son usados para escapar delimitadores en el template,
|
||||
en nuestro caso "{" or "}". Usted puede usar solo
|
||||
<link linkend="language.function.literal">{literal}{/literal}</link> para
|
||||
escapar bloques de texto.
|
||||
Vea tambien <link linkend="language.variables.smarty.ldelim">{$smarty.ldelim}</link>
|
||||
y <link linkend="language.variables.smarty.rdelim">{$smarty.rdelim}</link>
|
||||
</para>
|
||||
<example>
|
||||
<title>ldelim, rdelim</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{* Esto mostrara los delimitadores del template *}
|
||||
|
||||
{ldelim}funcname{rdelim} is how functions look in Smarty!
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
La salida del ejemplo de arriba:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
{funcname} is how functions look in Smarty!
|
||||
]]>
|
||||
</screen>
|
||||
</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
|
||||
-->
|
@@ -0,0 +1,71 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.function.literal">
|
||||
<title>literal</title>
|
||||
<para>
|
||||
Las etiquetas literal permiten que un block de datos sea tomado literalmente,
|
||||
no siendo interpretado por el smarty.
|
||||
Esto es util para cosas como secciones de javascript, en donde pueden
|
||||
haber llaves ("{}")
|
||||
y cosas asi que puedan confundir al interpretador del template.
|
||||
Cualquier cosa dentro las {literal}{/literal} no será
|
||||
interpretado, y sera mostrado tal como esta.
|
||||
|
||||
|
||||
|
||||
Las etiquetas literal permiten que un bloque de datos sea tomado
|
||||
literalmente, este es tipicamente usado en ambiente javascript o
|
||||
stylesheet bloques donde las llaves interfieren con los delimitadores
|
||||
de sintaxis de Samrty.
|
||||
Cualquer cosa dentro de las etiquetas {literal}{/literal} no es
|
||||
interpretado, si no desplegado tal como esta. Si usted necesita en su
|
||||
template etiquetas empotradas en su bloque de literal, considere usar
|
||||
<link linkend="language.function.ldelim">{ldelim}{rdelim}</link> para
|
||||
escapar delimitadores individuales en lugar de eso.
|
||||
</para>
|
||||
<example>
|
||||
<title>Etiqueta literal</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{literal}
|
||||
<script type="text/javascript">
|
||||
|
||||
<!--
|
||||
function isblank(field) {
|
||||
if (field.value == '')
|
||||
{ return false; }
|
||||
else
|
||||
{
|
||||
document.loginform.submit();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
// -->
|
||||
|
||||
</script>
|
||||
{/literal}
|
||||
]]>
|
||||
</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
|
||||
-->
|
@@ -0,0 +1,40 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.function.php">
|
||||
<title>php</title>
|
||||
<para>
|
||||
Las etiquetas php permiten que usted adicione c<>digo php directamente
|
||||
en el template. No ser<65> escapado, no importando la definici<63>n de
|
||||
<link linkend="variable.php.handling">$php_handling</link>.
|
||||
Esto es solo para usuario avanzados y normalmente no es necesario.
|
||||
</para>
|
||||
<example>
|
||||
<title>Etiqueta php</title>
|
||||
<programlisting>
|
||||
{php}
|
||||
// incluyendo un script php
|
||||
// directamente en el template.
|
||||
include("/path/to/display_weather.php");
|
||||
{/php}</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
|
||||
-->
|
@@ -0,0 +1,571 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.function.section">
|
||||
<title>section,sectionelse</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>name</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Si</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>El nombre de la section</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>loop</entry>
|
||||
<entry>[$variable_name]</entry>
|
||||
<entry>Si</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>El nombre de la variable para determinar el n<>mero de
|
||||
iteracciones</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>start</entry>
|
||||
<entry>integer</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>0</emphasis></entry>
|
||||
<entry> La posici<63>n del <20>ndice de la section donde va a comenzar.
|
||||
Si el valor es negativo, la posici<63>n del inicio se calculara
|
||||
a partir del final de la matriz. Por ejemplo, si hubieran 7 valores
|
||||
en la matriz y comienza por -2, el <20>ndice inicial es 5.
|
||||
Valores inv<6E>lidos (valores fuera del tama<6D>o de la matriz) son
|
||||
autom<6F>ticamente truncados para el valor valido mas pr<70>ximo.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>step</entry>
|
||||
<entry>integer</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>1</emphasis></entry>
|
||||
<entry>El valor del step que sera usado para el loop de la matriz.
|
||||
Por ejemplo, step=2 realizara el loop con los <20>ndices 0,2,4, etc.
|
||||
Si step es negativo, este avanzara en la matriz de atras para adelante.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>max</entry>
|
||||
<entry>integer</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Def<EFBFBD>ne el n<>mero m<>ximo de ciclos(loops) para la section.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>show</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>true</emphasis></entry>
|
||||
<entry>Determina cuando mostrar o no esta secci<63>n</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
Las section del template son usada para realizar un ciclo(loop) de
|
||||
un arreglo de datos. Todas las etiquetas <emphasis>section</emphasis>
|
||||
deben tener su par <emphasis>/section</emphasis>. Los par<61>metros
|
||||
requeridos son <emphasis>name</emphasis> y <emphasis>loop</emphasis>.
|
||||
El nombre de la section puede ser el que usted quiera, formado por
|
||||
letras, n<>meros y subrayados. Las sections pueden ser anidadas, y los
|
||||
nombres de la section anidadas deben ser diferentes unos de otros.
|
||||
Las variables del loop (normalmente una matriz de valores) determina
|
||||
el n<>mero de veces del loop de la section. Cuando estuviera mostrando
|
||||
una variable dentro de una section, el nombre de la section debe estar
|
||||
al lado de la variable dentro de corchetes [].
|
||||
<emphasis>sectionelse</emphasis> es ejecutado cuando no hubiera valores
|
||||
para la variable del loop(ciclo).
|
||||
</para>
|
||||
<example>
|
||||
<title>section</title>
|
||||
<programlisting>
|
||||
|
||||
{* este ejemplo muestra todos los valores del arreglo $custid *}
|
||||
{section name=customer loop=$custid}
|
||||
id: {$custid[customer]}<br>
|
||||
{/section}
|
||||
|
||||
SALIDA:
|
||||
|
||||
id: 1000<br>
|
||||
id: 1001<br>
|
||||
id: 1002<br></programlisting>
|
||||
</example>
|
||||
|
||||
<example>
|
||||
<title>loop(ciclo) de la variable section</title>
|
||||
<programlisting>
|
||||
{* la variable del loop solo determina el n<>mero de veces del ciclo.
|
||||
Usted puede accesar a cualquier variable del template dentro de la section.
|
||||
Este ejemplo asume que $custid, $name y $address son todas matrizes
|
||||
conteniendo el mismo n<>mero de valores *}
|
||||
{section name=customer loop=$custid}
|
||||
id: {$custid[customer]}<br>
|
||||
name: {$name[customer]}<br>
|
||||
address: {$address[customer]}<br>
|
||||
<p>
|
||||
{/section}
|
||||
|
||||
|
||||
SALIDA:
|
||||
|
||||
id: 1000<br>
|
||||
name: John Smith<br>
|
||||
address: 253 N 45th<br>
|
||||
<p>
|
||||
id: 1001<br>
|
||||
name: Jack Jones<br>
|
||||
address: 417 Mulberry ln<br>
|
||||
<p>
|
||||
id: 1002<br>
|
||||
name: Jane Munson<br>
|
||||
address: 5605 apple st<br>
|
||||
<p></programlisting>
|
||||
</example>
|
||||
|
||||
<example>
|
||||
<title>Nombres de section</title>
|
||||
<programlisting>
|
||||
{* El nombre de la section puede ser el que usted quiera,
|
||||
y es usado para referenciar los datos dentro de una section *}
|
||||
{section name=mydata loop=$custid}
|
||||
id: {$custid[mydata]}<br>
|
||||
name: {$name[mydata]}<br>
|
||||
address: {$address[mydata]}<br>
|
||||
<p>
|
||||
{/section}</programlisting>
|
||||
</example>
|
||||
|
||||
<example>
|
||||
<title>sections anidadas</title>
|
||||
<programlisting>
|
||||
{* Las sections pueden ser anidados tan profundamente como usted quiera.
|
||||
Con las sections anidadas, usted puede accesar a estructuras complejas,
|
||||
como una matriz multi-dimensional. En este ejemplo, $contact_type[customer]
|
||||
es una matriz de tipos de contacto para el cliente actual. *}
|
||||
{section name=customer loop=$custid}
|
||||
id: {$custid[customer]}<br>
|
||||
name: {$name[customer]}<br>
|
||||
address: {$address[customer]}<br>
|
||||
{section name=contact loop=$contact_type[customer]}
|
||||
{$contact_type[customer][contact]}: {$contact_info[customer][contact]}<br>
|
||||
{/section}
|
||||
<p>
|
||||
{/section}
|
||||
|
||||
|
||||
SALIDA:
|
||||
|
||||
id: 1000<br>
|
||||
name: John Smith<br>
|
||||
address: 253 N 45th<br>
|
||||
home phone: 555-555-5555<br>
|
||||
cell phone: 555-555-5555<br>
|
||||
e-mail: john@mydomain.com<br>
|
||||
<p>
|
||||
id: 1001<br>
|
||||
name: Jack Jones<br>
|
||||
address: 417 Mulberry ln<br>
|
||||
home phone: 555-555-5555<br>
|
||||
cell phone: 555-555-5555<br>
|
||||
e-mail: jack@mydomain.com<br>
|
||||
<p>
|
||||
id: 1002<br>
|
||||
name: Jane Munson<br>
|
||||
address: 5605 apple st<br>
|
||||
home phone: 555-555-5555<br>
|
||||
cell phone: 555-555-5555<br>
|
||||
e-mail: jane@mydomain.com<br>
|
||||
<p></programlisting>
|
||||
</example>
|
||||
|
||||
<example>
|
||||
<title>sections y matrices asociativas</title>
|
||||
<programlisting>
|
||||
{* Este es un ejemplo que muestra los datos de una matriz asociativa
|
||||
dentro de una section *}
|
||||
{section name=customer loop=$contacts}
|
||||
name: {$contacts[customer].name}<br>
|
||||
home: {$contacts[customer].home}<br>
|
||||
cell: {$contacts[customer].cell}<br>
|
||||
e-mail: {$contacts[customer].email}<p>
|
||||
{/section}
|
||||
|
||||
|
||||
SALIDA:
|
||||
|
||||
name: John Smith<br>
|
||||
home: 555-555-5555<br>
|
||||
cell: 555-555-5555<br>
|
||||
e-mail: john@mydomain.com<p>
|
||||
name: Jack Jones<br>
|
||||
home phone: 555-555-5555<br>
|
||||
cell phone: 555-555-5555<br>
|
||||
e-mail: jack@mydomain.com<p>
|
||||
name: Jane Munson<br>
|
||||
home phone: 555-555-5555<br>
|
||||
cell phone: 555-555-5555<br>
|
||||
e-mail: jane@mydomain.com<p></programlisting>
|
||||
</example>
|
||||
|
||||
|
||||
|
||||
<example>
|
||||
<title>sectionelse</title>
|
||||
<programlisting>
|
||||
{* sectionelse se ejecutara si no hubieran valores en $custid *}
|
||||
{section name=customer loop=$custid}
|
||||
id: {$custid[customer]}<br>
|
||||
{sectionelse}
|
||||
there are no values in $custid.
|
||||
{/section}</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Las sections tambi<62>n tiene sus propias variables que manipulan las
|
||||
propiedades de section. Estas son indicadas asi:
|
||||
{$smarty.section.sectionname.varname}
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
NOTA: a partir de Smarty 1.5.0, la sintaxis de las variables de las
|
||||
propiedades de section ha sido cambiadas de {%sectionname.varname%} a
|
||||
{$smarty.section.sectionname.varname}. La sintaxis antigua es aun
|
||||
soportada, pero usted puede ver la referencia de la sintaxis nueva
|
||||
en los ejemplos del manual.
|
||||
</para>
|
||||
</note>
|
||||
<sect2 id="section.property.index">
|
||||
<title>index</title>
|
||||
<para>
|
||||
index es usado para mostrar el <20>ndice actual del cliclo(loop), comenzando
|
||||
en cero (o comienza con el atributo dado), e incrementando por uno (o por
|
||||
un atributo de paso dado).
|
||||
</para>
|
||||
<note>
|
||||
<title>Nota Tecnica</title>
|
||||
<para>
|
||||
Si las propiedades de paso y comienzo del section son modificadas,
|
||||
entonces estas funcionan igual a las propiedades de iteration de la
|
||||
section, exepto que comienzan en 0 en vez de 1.
|
||||
</para>
|
||||
</note>
|
||||
<example>
|
||||
<title> section propiedades del index</title>
|
||||
<programlisting>
|
||||
{section name=customer loop=$custid}
|
||||
{$smarty.section.customer.index} id: {$custid[customer]}<br>
|
||||
{/section}
|
||||
|
||||
|
||||
SALIDA:
|
||||
|
||||
0 id: 1000<br>
|
||||
1 id: 1001<br>
|
||||
2 id: 1002<br>
|
||||
</programlisting>
|
||||
</example>
|
||||
</sect2>
|
||||
<sect2 id="section.property.index.prev">
|
||||
<title>index_prev</title>
|
||||
<para>
|
||||
El index_prev es usado para mostrar el <20>ndice anterior del loop(ciclo).
|
||||
del primer loop(ciclo) esto es definido como -1.
|
||||
</para>
|
||||
<example>
|
||||
<title>section propiedades del index_prev</title>
|
||||
<programlisting>
|
||||
{section name=customer loop=$custid}
|
||||
{$smarty.section.customer.index} id: {$custid[customer]}<br>
|
||||
{* FYI, $custid[customer.index] and $custid[customer] are identical in meaning *}
|
||||
{if $custid[customer.index_prev] ne $custid[customer.index]}
|
||||
The customer id changed<br>
|
||||
{/if}
|
||||
{/section}
|
||||
|
||||
|
||||
SALIDA:
|
||||
|
||||
0 id: 1000<br>
|
||||
The customer id changed<br>
|
||||
1 id: 1001<br>
|
||||
The customer id changed<br>
|
||||
2 id: 1002<br>
|
||||
The customer id changed<br>
|
||||
</programlisting>
|
||||
</example>
|
||||
</sect2>
|
||||
<sect2 id="section.property.index.next">
|
||||
<title>index_next</title>
|
||||
<para>
|
||||
El index_next es usado para mostrar el pr<70>ximo indice del loop.
|
||||
del <20>ltimo loop, esto es uno mas que el <20>ndice actual( respetando
|
||||
la definici<63>n del atributo step que se a dado.)
|
||||
</para>
|
||||
<example>
|
||||
<title>section propiedades del index_next</title>
|
||||
<programlisting>
|
||||
{section name=customer loop=$custid}
|
||||
{$smarty.section.customer.index} id: {$custid[customer]}<br>
|
||||
{* FYI, $custid[customer.index] and $custid[customer] are identical in meaning *}
|
||||
{if $custid[customer.index_next] ne $custid[customer.index]}
|
||||
The customer id will change<br>
|
||||
{/if}
|
||||
{/section}
|
||||
|
||||
|
||||
SALIDA:
|
||||
|
||||
0 id: 1000<br>
|
||||
The customer id will change<br>
|
||||
1 id: 1001<br>
|
||||
The customer id will change<br>
|
||||
2 id: 1002<br>
|
||||
The customer id will change<br>
|
||||
</programlisting>
|
||||
</example>
|
||||
</sect2>
|
||||
<sect2 id="section.property.iteration">
|
||||
<title>iteration</title>
|
||||
<para>
|
||||
iteration es usado para mostrar la iteraci<63>n actual del loop(ciclo).
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
Esto no es afectado por las propiedades del section start, step y max,
|
||||
distinto de las propriedades del index. Iteration tambi<62>n comineza con
|
||||
1 en vez de 0 como index. rownum es un alias de iteration, estas funcionan
|
||||
de manera identica.
|
||||
</para>
|
||||
</note>
|
||||
<example>
|
||||
<title>section propiedades de iteration</title>
|
||||
<programlisting>
|
||||
{section name=customer loop=$custid start=5 step=2}
|
||||
current loop iteration: {$smarty.section.customer.iteration}<br>
|
||||
{$smarty.section.customer.index} id: {$custid[customer]}<br>
|
||||
{* FYI, $custid[customer.index] and $custid[customer] are identical in meaning *}
|
||||
{if $custid[customer.index_next] ne $custid[customer.index]}
|
||||
The customer id will change<br>
|
||||
{/if}
|
||||
{/section}
|
||||
|
||||
|
||||
SALIDA:
|
||||
|
||||
current loop iteration: 1
|
||||
5 id: 1000<br>
|
||||
The customer id will change<br>
|
||||
current loop iteration: 2
|
||||
7 id: 1001<br>
|
||||
The customer id will change<br>
|
||||
current loop iteration: 3
|
||||
9 id: 1002<br>
|
||||
The customer id will change<br>
|
||||
</programlisting>
|
||||
</example>
|
||||
</sect2>
|
||||
<sect2 id="section.property.first">
|
||||
<title>first</title>
|
||||
<para>
|
||||
first es definido como true se la iteraci<63>n actual de la section es la primera.
|
||||
</para>
|
||||
<example>
|
||||
<title>section propiedades de first</title>
|
||||
<programlisting>
|
||||
{section name=customer loop=$custid}
|
||||
{if $smarty.section.customer.first}
|
||||
<table>
|
||||
{/if}
|
||||
|
||||
<tr><td>{$smarty.section.customer.index} id:
|
||||
{$custid[customer]}</td></tr>
|
||||
|
||||
{if $smarty.section.customer.last}
|
||||
</table>
|
||||
{/if}
|
||||
{/section}
|
||||
|
||||
|
||||
SALIDA:
|
||||
|
||||
<table>
|
||||
<tr><td>0 id: 1000</td></tr>
|
||||
<tr><td>1 id: 1001</td></tr>
|
||||
<tr><td>2 id: 1002</td></tr>
|
||||
</table>
|
||||
</programlisting>
|
||||
</example>
|
||||
</sect2>
|
||||
<sect2 id="section.property.last">
|
||||
<title>last</title>
|
||||
<para>
|
||||
last es definido como true si la iteraci<63>n actual del section es la ultima.
|
||||
</para>
|
||||
<example>
|
||||
<title>section propiedades de last</title>
|
||||
<programlisting>
|
||||
{section name=customer loop=$custid}
|
||||
{if $smarty.section.customer.first}
|
||||
<table>
|
||||
{/if}
|
||||
|
||||
<tr><td>{$smarty.section.customer.index} id:
|
||||
{$custid[customer]}</td></tr>
|
||||
|
||||
{if $smarty.section.customer.last}
|
||||
</table>
|
||||
{/if}
|
||||
{/section}
|
||||
|
||||
|
||||
SALIDA:
|
||||
|
||||
<table>
|
||||
<tr><td>0 id: 1000</td></tr>
|
||||
<tr><td>1 id: 1001</td></tr>
|
||||
<tr><td>2 id: 1002</td></tr>
|
||||
</table>
|
||||
</programlisting>
|
||||
</example>
|
||||
</sect2>
|
||||
<sect2 id="section.property.rownum">
|
||||
<title>rownum</title>
|
||||
<para>
|
||||
rownum es usado para mostrar la interaci<63>n actual del loop(ciclo),
|
||||
comenzando con 1. Es un alias para iteration, estas funcionan de
|
||||
modo identico.
|
||||
</para>
|
||||
<example>
|
||||
<title> section propiedades de rownum</title>
|
||||
<programlisting>
|
||||
{section name=customer loop=$custid}
|
||||
{$smarty.section.customer.rownum} id: {$custid[customer]}<br>
|
||||
{/section}
|
||||
|
||||
|
||||
SALIDA:
|
||||
|
||||
1 id: 1000<br>
|
||||
2 id: 1001<br>
|
||||
3 id: 1002<br>
|
||||
</programlisting>
|
||||
</example>
|
||||
</sect2>
|
||||
<sect2 id="section.property.loop">
|
||||
<title>loop</title>
|
||||
<para>
|
||||
loop es usado para mostrar el ultimo n<>mero del <20>ndice del
|
||||
loop(ciclo) de esta section. Esto puede ser usado dentro o fuera del section.
|
||||
</para>
|
||||
<example>
|
||||
<title>section propiedades de index</title>
|
||||
<programlisting>
|
||||
{section name=customer loop=$custid}
|
||||
{$smarty.section.customer.index} id: {$custid[customer]}<br>
|
||||
{/section}
|
||||
|
||||
There were {$smarty.section.customer.loop} customers shown above.
|
||||
|
||||
SALIDA:
|
||||
|
||||
0 id: 1000<br>
|
||||
1 id: 1001<br>
|
||||
2 id: 1002<br>
|
||||
|
||||
There were 3 customers shown above.
|
||||
</programlisting>
|
||||
</example>
|
||||
</sect2>
|
||||
<sect2 id="section.property.show">
|
||||
<title>show</title>
|
||||
<para>
|
||||
<emphasis>show</emphasis>Es usado como par<61>metro para section.
|
||||
<emphasis>show</emphasis> Es un valor booleano, true o false.
|
||||
Si es false, la section no ser<65> mostrada. Si existiera un
|
||||
sectionelse presente, este ser<65> alternativamente mostrado.
|
||||
</para>
|
||||
<example>
|
||||
<title>section atributos de show</title>
|
||||
<programlisting>
|
||||
{* $show_customer_info debe ser pasado de la aplicacion PHP,
|
||||
para regular cuando mostrar o no esta section shows*}
|
||||
{section name=customer loop=$custid show=$show_customer_info}
|
||||
{$smarty.section.customer.rownum} id: {$custid[customer]}<br>
|
||||
{/section}
|
||||
|
||||
{if $smarty.section.customer.show}
|
||||
the section was shown.
|
||||
{else}
|
||||
the section was not shown.
|
||||
{/if}
|
||||
|
||||
|
||||
SALIDA:
|
||||
|
||||
1 id: 1000<br>
|
||||
2 id: 1001<br>
|
||||
3 id: 1002<br>
|
||||
|
||||
the section was shown.
|
||||
</programlisting>
|
||||
</example>
|
||||
</sect2>
|
||||
<sect2 id="section.property.total">
|
||||
<title>total</title>
|
||||
<para>
|
||||
total es usado para mostrar el n<>mero de iteraciones que est<73>
|
||||
section tendra. Este puede ser usado dentro o fuera del section.
|
||||
</para>
|
||||
<example>
|
||||
<title>section propiedades de total</title>
|
||||
<programlisting>
|
||||
{section name=customer loop=$custid step=2}
|
||||
{$smarty.section.customer.index} id: {$custid[customer]}<br>
|
||||
{/section}
|
||||
|
||||
There were {$smarty.section.customer.total} customers shown above.
|
||||
|
||||
SALIDA:
|
||||
|
||||
0 id: 1000<br>
|
||||
2 id: 1001<br>
|
||||
4 id: 1002<br>
|
||||
|
||||
There were 3 customers shown above.
|
||||
</programlisting>
|
||||
</example>
|
||||
</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
|
||||
-->
|
@@ -0,0 +1,78 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.function.strip">
|
||||
<title>strip</title>
|
||||
<para>
|
||||
Muchas veces el dise<73>ador de web tiene problemas con los espacios en
|
||||
blanco y retornos de carro que afectan la salida del HTML
|
||||
(browser "features"), si usted tiene que colocar todas sus etiquetas
|
||||
juntas para tener los resultados deseados. Esto normalmente termina
|
||||
en un template ilegible o que no se puede leer.
|
||||
</para>
|
||||
<para>
|
||||
A cualquier cosa dentro de las etiquetas{strip}{/strip} en Smarty le
|
||||
son retirados los espacios en blanco y retornos de carro al inicio y
|
||||
al final de las lineas antes que sean mostrados.
|
||||
De este modo usted puede manter su template legible, y no se peocupara
|
||||
de que los espacios en blanco extras le causen problemas.
|
||||
</para>
|
||||
<note>
|
||||
<title>Nota T<>cnica</title>
|
||||
<para>
|
||||
{strip}{/strip} no afeta el contenido de las variables del template.
|
||||
Vea <link linkend="language.modifier.strip">strip modifier function</link>.
|
||||
</para>
|
||||
</note>
|
||||
<example>
|
||||
<title>strip tags</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{* El siguiente c<>digo se ejecutara todo junto en una sola linea de salida *}
|
||||
{strip}
|
||||
<table border=0>
|
||||
<tr>
|
||||
<td>
|
||||
<A HREF="{$url}">
|
||||
<font color="red">This is a test</font>
|
||||
</A>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
{/strip}
|
||||
|
||||
|
||||
SALIDA:
|
||||
|
||||
<table border=0><tr><td><A HREF="http://my.domain.com"><font color="red">This is a test</font></A></td></tr></table>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Note que en el ejemplo de arriba, todas las lineas comienzan y termina
|
||||
con etiquetas HTML. Tenga cuidado en que todas las lineas corran
|
||||
conjuntamente. Si usted tuviera textos planos simples en el inicio
|
||||
o en el final de una linea, este estaria junto, y puede no ser el
|
||||
resultado deseado.
|
||||
</para>
|
||||
</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
|
||||
-->
|
64
docs/es/designers/language-combining-modifiers.xml
Normal file
64
docs/es/designers/language-combining-modifiers.xml
Normal file
@@ -0,0 +1,64 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<chapter id="language.combining.modifiers">
|
||||
<title>Combinando Modificadores</title>
|
||||
<para>
|
||||
Usted puede aplicar cualquier cantidad de modificadores para una variable.
|
||||
Estos seran aplicados en el orden en el que fueron combinados, de izquierda
|
||||
a derecha. Estos deben ser separados con el car<61>cter <literal>|</literal>(pipe).
|
||||
</para>
|
||||
<example>
|
||||
<title>Combinando Modificadores</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
index.php:
|
||||
<?php
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('articleTitle', 'Smokers are Productive, but Death Cuts Efficiency.');
|
||||
$smarty->display('index.tpl');
|
||||
?>
|
||||
|
||||
index.tpl:
|
||||
|
||||
{$articleTitle}
|
||||
{$articleTitle|upper|spacify}
|
||||
{$articleTitle|lower|spacify|truncate}
|
||||
{$articleTitle|lower|truncate:30|spacify}
|
||||
{$articleTitle|lower|spacify|truncate:30:". . ."}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
La salida del ejemplode arriba:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Smokers are Productive, but Death Cuts Efficiency.
|
||||
S M O K E R S A R E P R O D U C T I V E , B U T D E A T H C U T S E F F I C I E N C Y .
|
||||
s m o k e r s a r e p r o d u c t i v e , b u t d e a t h c u t s...
|
||||
s m o k e r s a r e p r o d u c t i v e , b u t . . .
|
||||
s m o k e r s a r e p. . .
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</chapter>
|
||||
|
||||
<!-- 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
|
||||
-->
|
49
docs/es/designers/language-custom-functions.xml
Normal file
49
docs/es/designers/language-custom-functions.xml
Normal file
@@ -0,0 +1,49 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<chapter id="language.custom.functions">
|
||||
<title>Custom Functions</title>
|
||||
<para>
|
||||
Smarty viene con varias funciones personalizadas que usted
|
||||
puede usar en sus templates.
|
||||
</para>
|
||||
|
||||
&designers.language-custom-functions.language-function-assign;
|
||||
&designers.language-custom-functions.language-function-counter;
|
||||
&designers.language-custom-functions.language-function-cycle;
|
||||
&designers.language-custom-functions.language-function-debug;
|
||||
&designers.language-custom-functions.language-function-eval;
|
||||
&designers.language-custom-functions.language-function-fetch;
|
||||
&designers.language-custom-functions.language-function-html-checkboxes;
|
||||
&designers.language-custom-functions.language-function-html-image;
|
||||
&designers.language-custom-functions.language-function-html-options;
|
||||
&designers.language-custom-functions.language-function-html-radios;
|
||||
&designers.language-custom-functions.language-function-html-select-date;
|
||||
&designers.language-custom-functions.language-function-html-select-time;
|
||||
&designers.language-custom-functions.language-function-html-table;
|
||||
&designers.language-custom-functions.language-function-math;
|
||||
&designers.language-custom-functions.language-function-mailto;
|
||||
&designers.language-custom-functions.language-function-popup-init;
|
||||
&designers.language-custom-functions.language-function-popup;
|
||||
&designers.language-custom-functions.language-function-textformat;
|
||||
|
||||
</chapter>
|
||||
<!-- 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
|
||||
-->
|
@@ -0,0 +1,74 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.function.assign">
|
||||
<title>assign</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>var</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Si</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>El nombre de la variable que esta ganando el valor</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>value</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Si</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>El valor que esta siendo dado</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
assign es usado para definir valores a las variables de template
|
||||
durante la ejecuci<63>n del template.
|
||||
</para>
|
||||
<example>
|
||||
<title>assign</title>
|
||||
<programlisting>
|
||||
{assign var="name" value="Bob"}
|
||||
|
||||
The value of $name is {$name}.
|
||||
|
||||
SALIDA:
|
||||
|
||||
The value of $name is Bob.</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
|
||||
-->
|
@@ -0,0 +1,123 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.function.counter">
|
||||
<title>counter</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>name</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>default</emphasis></entry>
|
||||
<entry>El nombre del contador</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>start</entry>
|
||||
<entry>number</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>1</emphasis></entry>
|
||||
<entry>El n<>mero inicial para contar a partir de</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>skip</entry>
|
||||
<entry>number</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>1</emphasis></entry>
|
||||
<entry>El intervalo para contar</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>direction</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>up</emphasis></entry>
|
||||
<entry>La direcci<63>n para contar (up/down)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>print</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>true</emphasis></entry>
|
||||
<entry>Cuando mostrar o no el valor</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>
|
||||
counter es usada para mostrar un conteo. counter va a depender del
|
||||
conteo en cada iteraci<63>n. Usted puede ajustar el n<>mero, el intervalo
|
||||
y la direcci<63>n del conteo, asi como determinar cuando mostrar o no el
|
||||
conteo. Usted puede tener varios contadores al mismo tiempo, dando un
|
||||
nombre <20>nico para cada uno. Si usted no da un nombre, sera usado
|
||||
'default' como nombre.
|
||||
</para>
|
||||
<para>
|
||||
Si usted indica el atributo especial "assign", la salida de la funci<63>n
|
||||
counter se ira para esa variable del template en vez de ser mostrada en
|
||||
el template.
|
||||
</para>
|
||||
<example>
|
||||
<title>counter</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{* Inicia el conteo *}
|
||||
{counter start=0 skip=2}<br />
|
||||
{counter}<br />
|
||||
{counter}<br />
|
||||
{counter}<br />
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Esta es la salida:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
0<br />
|
||||
2<br />
|
||||
4<br />
|
||||
6<br />
|
||||
]]>
|
||||
</screen>
|
||||
</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
|
||||
-->
|
@@ -0,0 +1,138 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.function.cycle">
|
||||
<title>cycle</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>name</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>default</emphasis></entry>
|
||||
<entry>El nombre del ciclo</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>values</entry>
|
||||
<entry>mixed</entry>
|
||||
<entry>Si</entry>
|
||||
<entry><emphasis>N/A</emphasis></entry>
|
||||
<entry>Los valores del ciclo, o una lista delimitada por
|
||||
coma (vea el atributo delimiter), o una matriz de valores.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>print</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>true</emphasis></entry>
|
||||
<entry>Cuando mostrar o no el valor</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>advance</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>true</emphasis></entry>
|
||||
<entry>Cuando avanzar o no hacia el siguiente valor</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>delimiter</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>,</emphasis></entry>
|
||||
<entry>El delimitador para usar el valor del atributo.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>assign</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>La variable del template que recibir<69> la salida</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
Cycle es usado para hacer un ciclo a través de un conjunto
|
||||
de valores. Esto hace mas f<>cil alternar entre dos o mas colores
|
||||
en una tabla, o ciclos a trav<61>z de una matriz de valores.
|
||||
</para>
|
||||
<para>
|
||||
Usted puede usar el cycle en mas de un conjunto de valores en su
|
||||
template supliendo el atributo name. De cada uno de los conjuntos
|
||||
de valores.
|
||||
</para>
|
||||
<para>
|
||||
Usted puede forzar que el valor actual no sea mostrado definiendo
|
||||
el atributo print en false. Esto es <20>til para saltarse un valor.
|
||||
</para>
|
||||
<para>
|
||||
El atributo advance es usado para repetir un valor. cuando se
|
||||
definido en false, la pr<70>xima llamada para cycle mostrara el
|
||||
mismo valor.
|
||||
</para>
|
||||
<para>
|
||||
Si usted indica el atributo especial "assign", la saida de la
|
||||
funci<63>n cycle ira a la variable del template en vez de ser mostrado
|
||||
ditectamente en el template.
|
||||
</para>
|
||||
<example>
|
||||
<title>cycle</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{section name=rows loop=$data}
|
||||
<tr bgcolor="{cycle values="#eeeeee,#d0d0d0"}">
|
||||
<td>{$data[rows]}</td>
|
||||
</tr>
|
||||
{/section}
|
||||
]]>
|
||||
</programlisting>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
<tr bgcolor="#eeeeee">
|
||||
<td>1</td>
|
||||
</tr>
|
||||
<tr bgcolor="#d0d0d0">
|
||||
<td>2</td>
|
||||
</tr>
|
||||
<tr bgcolor="#eeeeee">
|
||||
<td>3</td>
|
||||
</tr>
|
||||
]]>
|
||||
</screen>
|
||||
</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
|
||||
-->
|
@@ -0,0 +1,61 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.function.debug">
|
||||
<title>debug</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>output</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>html</emphasis></entry>
|
||||
<entry>Tipo de salida, html o javascript</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
{debug} Muestra el debug de la consola en la pagina.
|
||||
Esto funciona independente de la definici<63>n de
|
||||
<link linkend="chapter.debugging.console">debug</link>.
|
||||
Ya que este es ejecutado en tiempo de ejecuci<63>n, este solo
|
||||
puede mostrar las variables definidas, no en el template, es
|
||||
decir en uso. Usted puede ver todas las variables disponibles
|
||||
del template con scope.
|
||||
</para>
|
||||
</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
|
||||
-->
|
@@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.function.eval">
|
||||
<title>eval</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>var</entry>
|
||||
<entry>mixed</entry>
|
||||
<entry>Si</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>variable (o cadena) para evaluar</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>assign</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>La variable del template que recibir<69> la salida</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
eval es usado para evaluar una variable como de template. Esto puede
|
||||
ser usado para cosas como incrustar tags(etiquetas)/variables del
|
||||
template dentro de las variables o tags(etiquetas)/variables dentro
|
||||
de las variables de un archivo de configuraci<63>n.
|
||||
</para>
|
||||
<para>
|
||||
Si usted indica el atributo especial "assign", la salida de la
|
||||
funci<63>n eval se ira para esta variable de template en vez de
|
||||
aparecer en el template.
|
||||
</para>
|
||||
<note>
|
||||
<title>Nota T<>cnica</title>
|
||||
<para>
|
||||
Al evaluar las variables son tratas igual que el template.
|
||||
Ellas sigen el mismo funcionamiento para escape y seguridad tal
|
||||
como si ellas fueran templates.
|
||||
</para>
|
||||
</note>
|
||||
<note>
|
||||
<title>Nota T<>cnica</title>
|
||||
<para>
|
||||
Las variables evaluadas son compiladas en cada invocaci<63>n, las
|
||||
vesiones compiladas no son salvas. Sin embargo, si usted tiene
|
||||
activado el cache, la salida se va a fijar en la cache junto con
|
||||
el resto del template.
|
||||
</para>
|
||||
</note>
|
||||
<example>
|
||||
<title>eval</title>
|
||||
<programlisting>
|
||||
setup.conf
|
||||
----------
|
||||
|
||||
emphstart = <b>
|
||||
emphend = </b>
|
||||
title = Welcome to {$company}'s home page!
|
||||
ErrorCity = You must supply a {#emphstart#}city{#emphend#}.
|
||||
ErrorState = You must supply a {#emphstart#}state{#emphend#}.
|
||||
|
||||
|
||||
index.tpl
|
||||
---------
|
||||
|
||||
{config_load file="setup.conf"}
|
||||
|
||||
{eval var=$foo}
|
||||
{eval var=#title#}
|
||||
{eval var=#ErrorCity#}
|
||||
{eval var=#ErrorState# assign="state_error"}
|
||||
{$state_error}
|
||||
|
||||
SALIDA:
|
||||
|
||||
This is the contents of foo.
|
||||
Welcome to Foobar Pub & Grill's home page!
|
||||
You must supply a <b>city</b>.
|
||||
You must supply a <b>state</b>.
|
||||
|
||||
</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
|
||||
-->
|
@@ -0,0 +1,109 @@
|
||||
<?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<EFBFBD>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<65> 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<63>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
|
||||
-->
|
@@ -0,0 +1,166 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.function.html.checkboxes">
|
||||
<title>html_checkboxes</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>name</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>checkbox</emphasis></entry>
|
||||
<entry>Nombre de la lista checkbox</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>values</entry>
|
||||
<entry>array</entry>
|
||||
<entry>Si, a menos que se este utilizando el atributo options</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Una matriz de valores para los botones checkbox</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>output</entry>
|
||||
<entry>array</entry>
|
||||
<entry>Si, a menos que estuviera usando el atributo options</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>una matriz de salida para los botones checkbox</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>selected/checked</entry>
|
||||
<entry>string/array</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>empty</emphasis></entry>
|
||||
<entry>El(s) elemento(s) checkbox marcado(s)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>options</entry>
|
||||
<entry>arreglo asociativo</entry>
|
||||
<entry>Si, a menos que este usando values y output</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Una matriz asociativa de valores y salida</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>separator</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>empty</emphasis></entry>
|
||||
<entry>Cadena de texto para separar cada checkbox</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>labels</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>true</emphasis></entry>
|
||||
<entry>Adicionar la etiqueta <label> para la salida</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
html_checkboxes es una funci<63>n personalizada que crea un grupo
|
||||
de checkbox con datos privistos. Este cuida cuales items(s)
|
||||
estan selecionados por default. Los atributos requeridos son
|
||||
values y output, a menos que usted use options.
|
||||
Toda la salida es compatible con XHTML.
|
||||
</para>
|
||||
<para>
|
||||
Todos los par<61>metros que no esten en la lista de arriba
|
||||
son mostrados como nombre/valor dentro de cada etiqueta
|
||||
<input> creada.
|
||||
</para>
|
||||
<example>
|
||||
<title>html_checkboxes</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
require('Smarty.class.php');
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('cust_ids', array(1000,1001,1002,1003));
|
||||
$smarty->assign('cust_names', array('Joe Schmoe','Jack Smith','Jane Johnson','Charlie Brown'));
|
||||
$smarty->assign('customer_id', 1001);
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
?>
|
||||
]]
|
||||
</programlisting>
|
||||
<para>
|
||||
where index.tpl is:
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{html_checkboxes name="id" values=$cust_ids selected=$customer_id output=$cust_names separator="<br />"}
|
||||
]]
|
||||
</programlisting>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
require('Smarty.class.php');
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('cust_checkboxes', array(
|
||||
1000 => 'Joe Schmoe',
|
||||
1001 => 'Jack Smith',
|
||||
1002 => 'Jane Johnson',
|
||||
1003 => 'Charlie Brown'));
|
||||
$smarty->assign('customer_id', 1001);
|
||||
$smarty->display('index.tpl');
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Donde index.tpl es:
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{html_checkboxes name="id" options=$cust_checkboxes selected=$customer_id separator="<br />"}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Salida (los dos ejemplos):
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
<label><input type="checkbox" name="id[]" value="1000" />Joe Schmoe</label><br />
|
||||
<label><input type="checkbox" name="id[]" value="1001" checked="checked" />Jack Smith</label><br />
|
||||
<label><input type="checkbox" name="id[]" value="1002" />Jane Johnson</label><br />
|
||||
<label><input type="checkbox" name="id[]" value="1003" />Charlie Brown</label><br />
|
||||
]]>
|
||||
</screen>
|
||||
</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
|
||||
-->
|
@@ -0,0 +1,160 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.function.html.image">
|
||||
<title>html_image</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>nombre/ruta de la imagen</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>border</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>0</emphasis></entry>
|
||||
<entry>Tama<EFBFBD>o del borde del contorno de la imagen</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>height</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>Altura actual de la imagen</emphasis></entry>
|
||||
<entry>altura con la cual la imagen debe ser mostrada</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>width</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>Largo actual de la imagen</emphasis></entry>
|
||||
<entry>largo con el cual la imagen debe ser mostrada</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>basedir</entry>
|
||||
<entry>string</entry>
|
||||
<entry>no</entry>
|
||||
<entry><emphasis>document root del servidor web</emphasis></entry>
|
||||
<entry>ruta relativa para la base del directorio</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>alt</entry>
|
||||
<entry>string</entry>
|
||||
<entry>no</entry>
|
||||
<entry><emphasis>""</emphasis></entry>
|
||||
<entry>descripci<EFBFBD>n alternativa de la imagen</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>href</entry>
|
||||
<entry>string</entry>
|
||||
<entry>no</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>valor href a donde la imagen ser<65> ligada</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
html_image es una funci<63>n habitual que genera una etiqueta
|
||||
HTML para una imagen. La altura y lo largo son autom<6F>ticamente
|
||||
calculadas a partir del archivo de la imagen si ning<6E>n valor
|
||||
suplido.
|
||||
</para>
|
||||
<para>
|
||||
basedir es el directorio base en el cual las rutas relativas de las
|
||||
imagenes estan basados. Si no lo proporciona, el document root del
|
||||
servidor (variable de ambiente DOCUMENT_ROOT) es usada como el
|
||||
directorio base. Si la seguridad esta habilitada, la ruta para la
|
||||
imagen debe estar dentro de un directorio seguro.
|
||||
</para>
|
||||
<para>
|
||||
<parameter>href</parameter> es el valor href a donde la imagen
|
||||
sera ligada. Si un link es proporcionado, una etiqueta <a
|
||||
href="LINKVALUE"><a> es puesta alrededor de la imagen.
|
||||
</para>
|
||||
<para>
|
||||
Todos los parametros que no esten dentro de la lista de arriba
|
||||
son mostrados como pares de nombre/valor dentro de la etiqueta
|
||||
creada <img>.
|
||||
</para>
|
||||
<note>
|
||||
<title>Nota T<>cnica</title>
|
||||
<para>
|
||||
html_image requiere un acceso a disco para leer la imagen y
|
||||
calcular la altura y el largo. Si usted no usa cache en el
|
||||
template, generalmente es mejor evitar html_image y utilizar
|
||||
las etiquetas de imagem est<73>ticas para un optimo funcionamiento.
|
||||
</para>
|
||||
</note>
|
||||
<example>
|
||||
<title>html_image example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
require('Smarty.class.php');
|
||||
$smarty = new Smarty;
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Donde index.tpl es:
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{html_image file="pumpkin.jpg"}
|
||||
{html_image file="/path/from/docroot/pumpkin.jpg"}
|
||||
{html_image file="../path/relative/to/currdir/pumpkin.jpg"}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
SALIDA (posible):
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
<img src="pumpkin.jpg" alt="" border="0" width="44" height="68" />
|
||||
<img src="/path/from/docroot/pumpkin.jpg" alt="" border="0" width="44" height="68" />
|
||||
<img src="../path/relative/to/currdir/pumpkin.jpg" alt="" border="0" width="44" height="68" />
|
||||
]]>
|
||||
</screen>
|
||||
</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
|
||||
-->
|
@@ -0,0 +1,151 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.function.html.options">
|
||||
<title>html_options</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>values</entry>
|
||||
<entry>array</entry>
|
||||
<entry>Si, a menos que use el atributo options</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>una matriz de valores para el menu dropdown</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>output</entry>
|
||||
<entry>array</entry>
|
||||
<entry>Si, a menos que use el atributo options</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>una matriz de salida para el menu dropdown</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>selected</entry>
|
||||
<entry>string/array</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>empty</emphasis></entry>
|
||||
<entry>los elemento(s) de la option selecionado(s)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>options</entry>
|
||||
<entry>arreglo asociativo</entry>
|
||||
<entry>Si, a menos que utilize valores y salida</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>una matriz asociativa de valores y salida</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>name</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>empty</emphasis></entry>
|
||||
<entry>nombre del grupo seleccionado</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
html_options es una funci<63>n customizada que crea un grupo
|
||||
html option con los datos proporcionados. Este se encarga de
|
||||
cuidar cuales datos han sido selecionado por default.
|
||||
Los atributos son valores y salidas, a menos que usted utilice
|
||||
options en lugar de eso.
|
||||
</para>
|
||||
<para>
|
||||
Si un valor es una matriz, este ser<65> tratado como un OPTGROUP html,
|
||||
y mostrara los grupos. La recursi<73>n es soportada por OPTGROUP.
|
||||
Todas las salidas son compatibles con XHTML.
|
||||
</para>
|
||||
<para>
|
||||
Si el atributo opcional <emphasis>name</emphasis> es dado, las
|
||||
etiquetas <select name="groupname"></select>
|
||||
encapsularan la lista de opciones.
|
||||
De otra manera solo es generada la lista de opciones.
|
||||
</para>
|
||||
<para>
|
||||
Todos los parámetros que no estan en la lista de arriba son
|
||||
exibidos como name/value-pairs dentro de las etiquetas <select>.
|
||||
Estas son ignoradas si la opcion <emphasis>name</emphasis> no es dada.
|
||||
</para>
|
||||
<example>
|
||||
<title>html_options</title>
|
||||
<programlisting>
|
||||
index.php:
|
||||
|
||||
require('Smarty.class.php');
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('cust_ids', array(1000,1001,1002,1003));
|
||||
$smarty->assign('cust_names', array('Joe Schmoe','Jack Smith','Jane
|
||||
Johnson','Carlie Brown'));
|
||||
$smarty->assign('customer_id', 1001);
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
index.tpl:
|
||||
|
||||
<select name=customer_id>
|
||||
{html_options values=$cust_ids selected=$customer_id output=$cust_names}
|
||||
</select>
|
||||
|
||||
|
||||
index.php:
|
||||
|
||||
require('Smarty.class.php');
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('cust_options', array(
|
||||
1001 => 'Joe Schmoe',
|
||||
1002 => 'Jack Smith',
|
||||
1003 => 'Jane Johnson',
|
||||
1004 => 'Charlie Brown'));
|
||||
$smarty->assign('customer_id', 1001);
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
index.tpl:
|
||||
|
||||
<select name=customer_id>
|
||||
{html_options options=$cust_options selected=$customer_id}
|
||||
</select>
|
||||
|
||||
|
||||
SALIDA: (Ambos ejemplos)
|
||||
|
||||
<select name=customer_id>
|
||||
<option value="1000">Joe Schmoe</option>
|
||||
<option value="1001" selected="selected">Jack Smith</option>
|
||||
<option value="1002">Jane Johnson</option>
|
||||
<option value="1003">Charlie Brown</option>
|
||||
</select></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
|
||||
-->
|
@@ -0,0 +1,143 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.function.html.radios">
|
||||
<title>html_radios</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>name</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>radio</emphasis></entry>
|
||||
<entry>Nombre de la lista del radio</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>values</entry>
|
||||
<entry>array</entry>
|
||||
<entry>Si, a menos que utilice el atributo options</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>una matriz de valores para radio buttons</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>output</entry>
|
||||
<entry>array</entry>
|
||||
<entry>Si, a menos que utilice el atributo options</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>una matriz de salida para radio buttons</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>selected</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>empty</emphasis></entry>
|
||||
<entry>El elemento del radio selccionado</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>options</entry>
|
||||
<entry>arreglo asociativo</entry>
|
||||
<entry>Si, a menos qie utilice valores y salida</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>una matriz asociativa de valores y salida</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>separator</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>empty</emphasis></entry>
|
||||
<entry>cadena de texto para separar cada objeto de radio</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
html_radios es una función customizada que crea grupos de
|
||||
botones de radio html con los datos proporcionados. Este esta
|
||||
atento para saber cual objeto esta selccionado por default.
|
||||
Los atributos requeridos son valores y salidas, a menos que usted
|
||||
use option en lugar de eso. Toda salida es compatible con XHTML.
|
||||
</para>
|
||||
<para>
|
||||
Todos los par<61>metros que no estan en la lista de arriba son impresos
|
||||
como pares de name/value dentro de cada etiqueta <input> creada.
|
||||
</para>
|
||||
|
||||
<example>
|
||||
<title>html_radios</title>
|
||||
<programlisting>
|
||||
index.php:
|
||||
|
||||
require('Smarty.class.php');
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('cust_ids', array(1000,1001,1002,1003));
|
||||
$smarty->assign('cust_names', array('Joe Schmoe','Jack Smith','Jane
|
||||
Johnson','Charlie Brown'));
|
||||
$smarty->assign('customer_id', 1001);
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
|
||||
index.tpl:
|
||||
|
||||
{html_radios name="id" values=$cust_ids selected=$customer_id output=$cust_names separator="<br />"}
|
||||
|
||||
|
||||
index.php:
|
||||
|
||||
require('Smarty.class.php');
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('cust_radios', array(
|
||||
1000 => 'Joe Schmoe',
|
||||
1001 => 'Jack Smith',
|
||||
1002 => 'Jane Johnson',
|
||||
1003 => 'Charlie Brown'));
|
||||
$smarty->assign('customer_id', 1001);
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
|
||||
index.tpl:
|
||||
|
||||
{html_radios name="id" options=$cust_radios selected=$customer_id separator="<br />"}
|
||||
|
||||
|
||||
SALIDA: (Ambos ejemplos)
|
||||
|
||||
<input type="radio" name="id" value="1000">Joe Schmoe<br />
|
||||
<input type="radio" name="id" value="1001" checked="checked">Jack Smith<br />
|
||||
<input type="radio" name="id" value="1002">Jane Johnson<br />
|
||||
<input type="radio" name="id" value="1003">Charlie Brown<br /></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
|
||||
-->
|
@@ -0,0 +1,366 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.function.html.select.date">
|
||||
<title>html_select_date</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>prefix</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry>Date_</entry>
|
||||
<entry>Con el prefijo el nombre de la variable</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>time</entry>
|
||||
<entry>timestamp/YYYY-MM-DD</entry>
|
||||
<entry>No</entry>
|
||||
<entry>Tiempo actual en el timestamp de unix o el
|
||||
formato YYYY-MM-DD</entry>
|
||||
<entry>Cual date/time a usar</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>start_year</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry>A<EFBFBD>o actual</entry>
|
||||
<entry> El primer a<>o primero en el menu dropdown, o
|
||||
el n<>mero de a<>o, o el relativo al a<>o actual (+/- N)
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>end_year</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry>de la misma forma que start_year</entry>
|
||||
<entry>El ultimo a<>o en el menu dropdown, o el
|
||||
n<>mero de a<>o, o el relativo al a<>o actual (+/- N)
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>display_days</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>No</entry>
|
||||
<entry>true</entry>
|
||||
<entry>Muestra los dias o no</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>display_months</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>No</entry>
|
||||
<entry>true</entry>
|
||||
<entry>Muestra los meses o no</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>display_years</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>No</entry>
|
||||
<entry>true</entry>
|
||||
<entry>Muestra los a<>os o no</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>month_format</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry>%B</entry>
|
||||
<entry>Cual debe ser el formato de salida del mes
|
||||
dentro de (strftime)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>day_format</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry>%02d</entry>
|
||||
<entry>Cual debe ser el formato de salida del dia
|
||||
dentro de (sprintf)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>day_value_format</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry>%d</entry>
|
||||
<entry>Cual debe ser el formato de salida del valor
|
||||
del dia dentro de (sprintf)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>year_as_text</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>No</entry>
|
||||
<entry>false</entry>
|
||||
<entry>Se mostrara o no el a<>o como texto</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>reverse_years</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>No</entry>
|
||||
<entry>false</entry>
|
||||
<entry>Muestra los a<>os en orden inverso</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>field_array</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry>null</entry>
|
||||
<entry>
|
||||
si un nombre es dado, las cajas de seleci<63>n
|
||||
seran exibidas semejantes a los resultados
|
||||
que estaran retornando al PHP en la forma.
|
||||
name[Day], name[Year], name[Month].
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>day_size</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry>null</entry>
|
||||
<entry>adiciona el tama<6D>o al atributo para la
|
||||
etiqueta select si fue dada</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>month_size</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry>null</entry>
|
||||
<entry>adiciona el tama<6D>o del atributo para la
|
||||
etiqueta select si fue dada</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>year_size</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry>null</entry>
|
||||
<entry>adiciona el tama<6D>o del atributo para la
|
||||
etiqueta select si fue dada</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>all_extra</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry>null</entry>
|
||||
<entry>adiciona atributos extras para todas las
|
||||
etiquetas select/input si fueron dadas</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>day_extra</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry>null</entry>
|
||||
<entry>adiciona atributos extras para todas las
|
||||
etiquetas select/input si fueron dadas</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>month_extra</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry>null</entry>
|
||||
<entry>adiciona atributos extras para todas las
|
||||
etiquetas select/input si fueron dadas</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>year_extra</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry>null</entry>
|
||||
<entry>adiciona atributos extras para todas las
|
||||
etiquetas select/input si fueron dadas</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>field_order</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry>MDY</entry>
|
||||
<entry>El orden para ser mostrados los campos</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>field_separator</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry>\n</entry>
|
||||
<entry>Cadena a mostrar entre los diferentes campos</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>month_value_format</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry>%m</entry>
|
||||
<entry> formato strftime de los valores del mes,
|
||||
el default es %m para el n<>mero del mes.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>year_empty</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry>null</entry>
|
||||
<entry>Si es proporcionado entonces el primer elemento
|
||||
es el a<>o select-box tiene este valor como etiqueta y
|
||||
"" como valor.
|
||||
Esto es util para hacer una lectura en el select-box
|
||||
por ejemplo "por favor seccione el a<>o".
|
||||
Note que este puede usar valores como "-MM-DD" como
|
||||
atributos de time indicando que el a<>o sea desmarcado.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>month_empty</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry>null</entry>
|
||||
<entry>Si es proporcinado entonces el mes es el primer
|
||||
elemento select-box tiene este valor como etiqueta y
|
||||
"" como valor.
|
||||
Note que usted puede usar valores como "YYYY--DD" como
|
||||
atributos de time indicando que el mes sea desmarcado.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>day_empty</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry>null</entry>
|
||||
<entry>Si es proporcinado entonces es dias es el
|
||||
primer elemento select-box tiene este valor como
|
||||
etiqueta y "" como valor.
|
||||
Note que usted puede usar valores como "YYYY-MM--"
|
||||
como atributos de time indicando que el dia sea
|
||||
desmarcado.
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
html_select_date es una funci<63>n customizada que crea menus dropdowns
|
||||
de fechas para usted. Este puede mostrar algunos o todos por a<>o,
|
||||
mes y dia.
|
||||
</para>
|
||||
<example>
|
||||
<title>html_select_date</title>
|
||||
<programlisting>
|
||||
{html_select_date}
|
||||
|
||||
|
||||
SALIDA:
|
||||
|
||||
<select name="Date_Month">
|
||||
<option value="1">January</option>
|
||||
<option value="2">February</option>
|
||||
<option value="3">March</option>
|
||||
<option value="4">April</option>
|
||||
<option value="5">May</option>
|
||||
<option value="6">June</option>
|
||||
<option value="7">July</option>
|
||||
<option value="8">August</option>
|
||||
<option value="9">September</option>
|
||||
<option value="10">October</option>
|
||||
<option value="11">November</option>
|
||||
<option value="12" selected>December</option>
|
||||
</select>
|
||||
<select name="Date_Day">
|
||||
<option value="1">01</option>
|
||||
<option value="2">02</option>
|
||||
<option value="3">03</option>
|
||||
<option value="4">04</option>
|
||||
<option value="5">05</option>
|
||||
<option value="6">06</option>
|
||||
<option value="7">07</option>
|
||||
<option value="8">08</option>
|
||||
<option value="9">09</option>
|
||||
<option value="10">10</option>
|
||||
<option value="11">11</option>
|
||||
<option value="12">12</option>
|
||||
<option value="13" selected>13</option>
|
||||
<option value="14">14</option>
|
||||
<option value="15">15</option>
|
||||
<option value="16">16</option>
|
||||
<option value="17">17</option>
|
||||
<option value="18">18</option>
|
||||
<option value="19">19</option>
|
||||
<option value="20">20</option>
|
||||
<option value="21">21</option>
|
||||
<option value="22">22</option>
|
||||
<option value="23">23</option>
|
||||
<option value="24">24</option>
|
||||
<option value="25">25</option>
|
||||
<option value="26">26</option>
|
||||
<option value="27">27</option>
|
||||
<option value="28">28</option>
|
||||
<option value="29">29</option>
|
||||
<option value="30">30</option>
|
||||
<option value="31">31</option>
|
||||
</select>
|
||||
<select name="Date_Year">
|
||||
<option value="2001" selected>2001</option>
|
||||
</select></programlisting>
|
||||
</example>
|
||||
|
||||
|
||||
<example>
|
||||
<title>html_select_date</title>
|
||||
<programlisting>
|
||||
|
||||
{* el a<>o de comienzo y fin puede ser relativo al a<>o actual *}
|
||||
{html_select_date prefix="StartDate" time=$time start_year="-5" end_year="+1" display_days=false}
|
||||
|
||||
SALIDA: (El a<>o actual es 2000)
|
||||
|
||||
<select name="StartDateMonth">
|
||||
<option value="1">January</option>
|
||||
<option value="2">February</option>
|
||||
<option value="3">March</option>
|
||||
<option value="4">April</option>
|
||||
<option value="5">May</option>
|
||||
<option value="6">June</option>
|
||||
<option value="7">July</option>
|
||||
<option value="8">August</option>
|
||||
<option value="9">September</option>
|
||||
<option value="10">October</option>
|
||||
<option value="11">November</option>
|
||||
<option value="12" selected>December</option>
|
||||
</select>
|
||||
<select name="StartDateYear">
|
||||
<option value="1999">1995</option>
|
||||
<option value="1999">1996</option>
|
||||
<option value="1999">1997</option>
|
||||
<option value="1999">1998</option>
|
||||
<option value="1999">1999</option>
|
||||
<option value="2000" selected>2000</option>
|
||||
<option value="2001">2001</option>
|
||||
</select></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
|
||||
-->
|
@@ -0,0 +1,341 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.function.html.select.time">
|
||||
<title>html_select_time</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>prefix</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry>Time_</entry>
|
||||
<entry>con el prefijo el nombre de la variable</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>time</entry>
|
||||
<entry>timestamp</entry>
|
||||
<entry>No</entry>
|
||||
<entry>current time</entry>
|
||||
<entry>cual date/time va a usar</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>display_hours</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>No</entry>
|
||||
<entry>true</entry>
|
||||
<entry>Mostrar o no las horas</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>display_minutes</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>No</entry>
|
||||
<entry>true</entry>
|
||||
<entry>Mostrar o no los minutos</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>display_seconds</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>No</entry>
|
||||
<entry>true</entry>
|
||||
<entry>Mostrar o no los segundos</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>display_meridian</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>No</entry>
|
||||
<entry>true</entry>
|
||||
<entry>Mostrar o no el meridiano (am/pm)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>use_24_hours</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>No</entry>
|
||||
<entry>true</entry>
|
||||
<entry>Usar o no reloj de 24 horas</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>minute_interval</entry>
|
||||
<entry>integer</entry>
|
||||
<entry>No</entry>
|
||||
<entry>1</entry>
|
||||
<entry>n<EFBFBD>mero de los intervalos de los minutos del menu dropdown</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>second_interval</entry>
|
||||
<entry>integer</entry>
|
||||
<entry>No</entry>
|
||||
<entry>1</entry>
|
||||
<entry>n<EFBFBD>mero de los intervalos de los segundos del menu dropdown</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>field_array</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry>n/a</entry>
|
||||
<entry>muestra los valores del arreglo con este nombre</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>all_extra</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry>null</entry>
|
||||
<entry>adiciona atributos extras a las etiquetas select/input
|
||||
si fueron proporcionados</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>hour_extra</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry>null</entry>
|
||||
<entry>adiciona atributos extras a las etiquetas select/input
|
||||
si fueron proporcionados</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>minute_extra</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry>null</entry>
|
||||
<entry>adiciona atributos extras a las etiquetas select/input
|
||||
si fueron proporcionados</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>second_extra</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry>null</entry>
|
||||
<entry>adiciona atributos extras a las etiquetas select/input
|
||||
si fueron proporcionados</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>meridian_extra</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry>null</entry>
|
||||
<entry>adiciona atributos extras a las etiquetas select/input
|
||||
si fueron proporcionados</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
html_select_time es una funci<63>n customizada
|
||||
que crea menus dropdowns de tiempo para usted.
|
||||
Esta puede mostrar algunos valores, o
|
||||
todo en hora, minuto, segundo y am/pm.
|
||||
</para>
|
||||
<para>
|
||||
Los atributos de time pueden tener diferentes
|
||||
formatos. el puede ser un unico timestamp o
|
||||
una cadena conteniendo Y-M-D. YYYY-MM-DD puede
|
||||
ser lo mas com<6F>n. exepto meses y dias con menos
|
||||
de dos digitos tambi<62>n son reconocidos;
|
||||
Si uno de los 3 valores (Y,M,D) es una cadena
|
||||
vacia, que segun el select-box no es pre-seleccionada
|
||||
del todo. este es especialmente usado con los
|
||||
atributos empty_teay-, -month- y -day-.
|
||||
</para>
|
||||
<example>
|
||||
<title>html_select_time</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{html_select_time use_24_hours=true}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Esta es la salidat:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
<select name="Time_Hour">
|
||||
<option value="00">00</option>
|
||||
<option value="01">01</option>
|
||||
<option value="02">02</option>
|
||||
<option value="03">03</option>
|
||||
<option value="04">04</option>
|
||||
<option value="05">05</option>
|
||||
<option value="06">06</option>
|
||||
<option value="07">07</option>
|
||||
<option value="08">08</option>
|
||||
<option value="09" selected>09</option>
|
||||
<option value="10">10</option>
|
||||
<option value="11">11</option>
|
||||
<option value="12">12</option>
|
||||
<option value="13">13</option>
|
||||
<option value="14">14</option>
|
||||
<option value="15">15</option>
|
||||
<option value="16">16</option>
|
||||
<option value="17">17</option>
|
||||
<option value="18">18</option>
|
||||
<option value="19">19</option>
|
||||
<option value="20">20</option>
|
||||
<option value="21">21</option>
|
||||
<option value="22">22</option>
|
||||
<option value="23">23</option>
|
||||
</select>
|
||||
<select name="Time_Minute">
|
||||
<option value="00">00</option>
|
||||
<option value="01">01</option>
|
||||
<option value="02">02</option>
|
||||
<option value="03">03</option>
|
||||
<option value="04">04</option>
|
||||
<option value="05">05</option>
|
||||
<option value="06">06</option>
|
||||
<option value="07">07</option>
|
||||
<option value="08">08</option>
|
||||
<option value="09">09</option>
|
||||
<option value="10">10</option>
|
||||
<option value="11">11</option>
|
||||
<option value="12">12</option>
|
||||
<option value="13">13</option>
|
||||
<option value="14">14</option>
|
||||
<option value="15">15</option>
|
||||
<option value="16">16</option>
|
||||
<option value="17">17</option>
|
||||
<option value="18">18</option>
|
||||
<option value="19">19</option>
|
||||
<option value="20" selected>20</option>
|
||||
<option value="21">21</option>
|
||||
<option value="22">22</option>
|
||||
<option value="23">23</option>
|
||||
<option value="24">24</option>
|
||||
<option value="25">25</option>
|
||||
<option value="26">26</option>
|
||||
<option value="27">27</option>
|
||||
<option value="28">28</option>
|
||||
<option value="29">29</option>
|
||||
<option value="30">30</option>
|
||||
<option value="31">31</option>
|
||||
<option value="32">32</option>
|
||||
<option value="33">33</option>
|
||||
<option value="34">34</option>
|
||||
<option value="35">35</option>
|
||||
<option value="36">36</option>
|
||||
<option value="37">37</option>
|
||||
<option value="38">38</option>
|
||||
<option value="39">39</option>
|
||||
<option value="40">40</option>
|
||||
<option value="41">41</option>
|
||||
<option value="42">42</option>
|
||||
<option value="43">43</option>
|
||||
<option value="44">44</option>
|
||||
<option value="45">45</option>
|
||||
<option value="46">46</option>
|
||||
<option value="47">47</option>
|
||||
<option value="48">48</option>
|
||||
<option value="49">49</option>
|
||||
<option value="50">50</option>
|
||||
<option value="51">51</option>
|
||||
<option value="52">52</option>
|
||||
<option value="53">53</option>
|
||||
<option value="54">54</option>
|
||||
<option value="55">55</option>
|
||||
<option value="56">56</option>
|
||||
<option value="57">57</option>
|
||||
<option value="58">58</option>
|
||||
<option value="59">59</option>
|
||||
</select>
|
||||
<select name="Time_Second">
|
||||
<option value="00">00</option>
|
||||
<option value="01">01</option>
|
||||
<option value="02">02</option>
|
||||
<option value="03">03</option>
|
||||
<option value="04">04</option>
|
||||
<option value="05">05</option>
|
||||
<option value="06">06</option>
|
||||
<option value="07">07</option>
|
||||
<option value="08">08</option>
|
||||
<option value="09">09</option>
|
||||
<option value="10">10</option>
|
||||
<option value="11">11</option>
|
||||
<option value="12">12</option>
|
||||
<option value="13">13</option>
|
||||
<option value="14">14</option>
|
||||
<option value="15">15</option>
|
||||
<option value="16">16</option>
|
||||
<option value="17">17</option>
|
||||
<option value="18">18</option>
|
||||
<option value="19">19</option>
|
||||
<option value="20">20</option>
|
||||
<option value="21">21</option>
|
||||
<option value="22">22</option>
|
||||
<option value="23" selected>23</option>
|
||||
<option value="24">24</option>
|
||||
<option value="25">25</option>
|
||||
<option value="26">26</option>
|
||||
<option value="27">27</option>
|
||||
<option value="28">28</option>
|
||||
<option value="29">29</option>
|
||||
<option value="30">30</option>
|
||||
<option value="31">31</option>
|
||||
<option value="32">32</option>
|
||||
<option value="33">33</option>
|
||||
<option value="34">34</option>
|
||||
<option value="35">35</option>
|
||||
<option value="36">36</option>
|
||||
<option value="37">37</option>
|
||||
<option value="38">38</option>
|
||||
<option value="39">39</option>
|
||||
<option value="40">40</option>
|
||||
<option value="41">41</option>
|
||||
<option value="42">42</option>
|
||||
<option value="43">43</option>
|
||||
<option value="44">44</option>
|
||||
<option value="45">45</option>
|
||||
<option value="46">46</option>
|
||||
<option value="47">47</option>
|
||||
<option value="48">48</option>
|
||||
<option value="49">49</option>
|
||||
<option value="50">50</option>
|
||||
<option value="51">51</option>
|
||||
<option value="52">52</option>
|
||||
<option value="53">53</option>
|
||||
<option value="54">54</option>
|
||||
<option value="55">55</option>
|
||||
<option value="56">56</option>
|
||||
<option value="57">57</option>
|
||||
<option value="58">58</option>
|
||||
<option value="59">59</option>
|
||||
</select>
|
||||
<select name="Time_Meridian">
|
||||
<option value="am" selected>AM</option>
|
||||
<option value="pm">PM</option>
|
||||
</select>
|
||||
]]>
|
||||
</screen>
|
||||
</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
|
||||
-->
|
@@ -0,0 +1,158 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.function.html.table">
|
||||
<title>html_table</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>loop</entry>
|
||||
<entry>array</entry>
|
||||
<entry>Yes</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>matriz de datos para el ciclo(loop)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>cols</entry>
|
||||
<entry>integer</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>3</emphasis></entry>
|
||||
<entry>n<EFBFBD>mero de columnas para la tabla</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>table_attr</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>border="1"</emphasis></entry>
|
||||
<entry>atributos para la etiqueta table</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>tr_attr</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>empty</emphasis></entry>
|
||||
<entry>atributos para la etiqueta tr (arreglos del ciclo)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>td_attr</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>empty</emphasis></entry>
|
||||
<entry>atributos para la etiqueta td (arreglos del ciclo)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>trailpad</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>&nbsp;</emphasis></entry>
|
||||
<entry>valor de relleno de las celdas para el ultimo
|
||||
renglon con (si hay alguno)</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry>hdir</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>right</emphasis></entry>
|
||||
<entry> direcci<63>n de una linea para ser representada.
|
||||
posibles valores: <emphasis>left</emphasis>/<emphasis>right</emphasis>
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>vdir</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>down</emphasis></entry>
|
||||
<entry>Direcci<EFBFBD>n de las columnas para ser representadas.
|
||||
posibles valores: <emphasis>up</emphasis>/<emphasis>down</emphasis>
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
<emphasis>html_table</emphasis> Es una funci<63>n customizada que
|
||||
transforma un arreglo de datos en una tabla HTML.
|
||||
El atributo <emphasis>cols</emphasis> determina el n<>mero de
|
||||
columnas que tendra la tabla.
|
||||
Los valores <emphasis>table_attr</emphasis>,
|
||||
<emphasis>tr_attr</emphasis> y <emphasis>td_attr</emphasis>
|
||||
determinan los atributos dados para las etiquetas tabla, tr y td.
|
||||
Si <emphasis>tr_attr</emphasis> o <emphasis>td_attr</emphasis>
|
||||
son arreglos, ellos entraran en un ciclo.
|
||||
<emphasis>trailpad</emphasis> y el valor depositado dentro de
|
||||
trailing cells en la ultima linea de la tabla si existe alguna
|
||||
presente.
|
||||
</para>
|
||||
<example>
|
||||
<title>html_table</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
index.php:
|
||||
|
||||
require('Smarty.class.php');
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('data',array(1,2,3,4,5,6,7,8,9));
|
||||
$smarty->assign('tr',array('bgcolor="#eeeeee"','bgcolor="#dddddd"'));
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
index.tpl:
|
||||
|
||||
{html_table loop=$data}
|
||||
{html_table loop=$data cols=4 table_attr='border="0"'}
|
||||
{html_table loop=$data cols=4 tr_attr=$tr}
|
||||
|
||||
SALIDA:
|
||||
|
||||
<table border="1">
|
||||
<tr><td>1</td><td>2</td><td>3</td></tr>
|
||||
<tr><td>4</td><td>5</td><td>6</td></tr>
|
||||
<tr><td>7</td><td>8</td><td>9</td></tr>
|
||||
</table>
|
||||
<table border="0">
|
||||
<tr><td>1</td><td>2</td><td>3</td><td>4</td></tr>
|
||||
<tr><td>5</td><td>6</td><td>7</td><td>8</td></tr>
|
||||
<tr><td>9</td><td> </td><td> </td><td> </td></tr>
|
||||
</table>
|
||||
<table border="1">
|
||||
<tr bgcolor="#eeeeee"><td>1</td><td>2</td><td>3</td><td>4</td></tr>
|
||||
<tr bgcolor="#dddddd"><td>5</td><td>6</td><td>7</td><td>8</td></tr>
|
||||
<tr bgcolor="#eeeeee"><td>9</td><td> </td><td> </td><td> </td></tr>
|
||||
</table>
|
||||
]]></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
|
||||
-->
|
@@ -0,0 +1,155 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.function.mailto">
|
||||
<title>mailto</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>address</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Yes</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>La direcci<63>n de correo electronico(e-mail)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>text</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>El texto para mostrar, el default es la
|
||||
direcci<63>n de correo (e-mail)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>encode</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>none</emphasis></entry>
|
||||
<entry>Como codificar el e-mail. Puede ser none, hex o javascript.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>cc</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry> La direcci<63>n de correo(e-mail) para mandar una
|
||||
copia el carbon(cc). Separados por una coma.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>bcc</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Direcci<EFBFBD>n de correo electronico(e-mail) para mandar
|
||||
una copia al carbon ofuscada(bcc). Separando las direcciones por comas.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>subject</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Asunto del correo electronico(e-mail).</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>newsgroups</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>newsgroup para enviar. separando las direcciones por comas.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>followupto</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Direcciones para acompa<70>ar. Separe las direcciones con comas.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>extra</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry> Cualquier otra informaci<63>n que usted quiera pasar
|
||||
por el link, tal como plantillas de estilo
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
mailto automatiza el proceso de creaci<63>n de links de correo
|
||||
electronico(e-mail) y opcionalmente los codifica.
|
||||
Codificar el correo electronico(e-mail) hace mas dif<69>cil que
|
||||
las web spiders tomen las direciones de nuestro sitio.
|
||||
</para>
|
||||
<note>
|
||||
<title>Nota T<>cnica</title>
|
||||
<para>
|
||||
javascript es probablemente el codificador mas utilizado, aunque
|
||||
usted puede utilizar tambi<62>n codificaci<63>n hexadecimal.
|
||||
</para>
|
||||
</note>
|
||||
<example>
|
||||
<title>mailto</title>
|
||||
<programlisting>
|
||||
{mailto address="me@domain.com"}
|
||||
{mailto address="me@domain.com" text="send me some mail"}
|
||||
{mailto address="me@domain.com" encode="javascript"}
|
||||
{mailto address="me@domain.com" encode="hex"}
|
||||
{mailto address="me@domain.com" subject="Hello to you!"}
|
||||
{mailto address="me@domain.com" cc="you@domain.com,they@domain.com"}
|
||||
{mailto address="me@domain.com" extra='class="email"'}
|
||||
|
||||
SALIDA:
|
||||
|
||||
<a href="mailto:me@domain.com" >me@domain.com</a>
|
||||
<a href="mailto:me@domain.com" >send me some mail</a>
|
||||
<script type="text/javascript" language="javascript">eval(unescape('%64%6f%63%75%6d%65%6e%74%2e%77%72%6
|
||||
9%74%65%28%27%3c%61%20%68%72%65%66%3d%22%6d%61%69%6c%74%6f%3a%6d%65%40%64%6f%6d%
|
||||
61%69%6e%2e%63%6f%6d%22%20%3e%6d%65%40%64%6f%6d%61%69%6e%2e%63%6f%6d%3c%2f%61%3e
|
||||
%27%29%3b'))</script>
|
||||
<a href="mailto:%6d%65@%64%6f%6d%61%69%6e.%63%6f%6d" >me@domain.com</a>
|
||||
<a href="mailto:me@domain.com?subject=Hello%20to%20you%21" >me@domain.com</a>
|
||||
<a href="mailto:me@domain.com?cc=you@domain.com%2Cthey@domain.com" >me@domain.com</a>
|
||||
<a href="mailto:me@domain.com" class="email">me@domain.com</a></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
|
||||
-->
|
@@ -0,0 +1,149 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.function.math">
|
||||
<title>math</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>equation</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Si</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>La ecuaci<63>n a ejecutar</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>format</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>El formato del resultado (sprintf)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>var</entry>
|
||||
<entry>numeric</entry>
|
||||
<entry>Si</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Valor de la variable de la ecuaci<63>n</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>assign</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Variable de template cuya salida sera asignada</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>[var ...]</entry>
|
||||
<entry>numeric</entry>
|
||||
<entry>Si</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Valor de la variable de la ecuaci<63>n</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
math permite dise<73>ar ecuaciones matem<65>ticas dentro del template.
|
||||
Cualquier variable num<75>rica del template puede ser usada en
|
||||
ecuaciones, y el resultado es mostrado en lugar de la etiqueta.
|
||||
Las variables usadas en ecuaciones son pasadas como par<61>metros,
|
||||
que pueden ser variables de template o valores est<73>ticos.
|
||||
+, -, /, *, abs, ceil, cos, exp, floor, log, log10, max, min,
|
||||
pi, pow, rand, round, sin, sqrt, srans y tan son todos los
|
||||
operadores validos. Verifique la documentaci<63>n de PHP para mas
|
||||
informaci<63>n acerca de estas funciones matem<65>ticas.
|
||||
</para>
|
||||
<para>
|
||||
Si usted proporciona el atributo especial "assign", la salida de la
|
||||
funci<63>n matem<65>tica ser<65> atribuido a esta variable de template en
|
||||
vez de ser mostrada en el template.
|
||||
</para>
|
||||
<note>
|
||||
<title>Nota T<>cnica</title>
|
||||
<para>
|
||||
math es una funci<63>n de muy alto rendimiento debido a que se
|
||||
puede usar con la funci<63>n eval() de PHP.
|
||||
Hacer las matem<65>ticas en PHP es mucho mas eficiente, asi en
|
||||
cualquier momento es posible hacer calculos matem<65>ticos en PHP
|
||||
asignarlos a una variable y lanzar los resultados al template.
|
||||
Def<65>nitivamente evite llamadas repetitivas de funciones
|
||||
matem<65>ticas, dentro de los ciclos section.
|
||||
</para>
|
||||
</note>
|
||||
<example>
|
||||
<title>math</title>
|
||||
<programlisting>
|
||||
{* $height=4, $width=5 *}
|
||||
|
||||
{math equation="x + y" x=$height y=$width}
|
||||
|
||||
SALIDA:
|
||||
|
||||
9
|
||||
|
||||
|
||||
{* $row_height = 10, $row_width = 20, #col_div# = 2, assigned in template *}
|
||||
|
||||
{math equation="height * width / division"
|
||||
height=$row_height
|
||||
width=$row_width
|
||||
division=#col_div#}
|
||||
|
||||
SALIDA:
|
||||
|
||||
100
|
||||
|
||||
|
||||
{* Usted puede usar parentesis *}
|
||||
|
||||
{math equation="(( x + y ) / z )" x=2 y=10 z=2}
|
||||
|
||||
SALIDA:
|
||||
|
||||
6
|
||||
|
||||
|
||||
{* Usted puede asignar un par<61>metro de formato en sprintf *}
|
||||
|
||||
{math equation="x + y" x=4.4444 y=5.0000 format="%.2f"}
|
||||
|
||||
SALIDA:
|
||||
|
||||
9.44</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
|
||||
-->
|
@@ -0,0 +1,49 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.function.popup.init">
|
||||
<title>popup_init</title>
|
||||
<para>
|
||||
popup es una integraci<63>n de overLib, una biblioteca usada para
|
||||
ventanas popup. Esta es usada como contexto de infomaci<63>n sensitiva,
|
||||
como ventanas de ayuda o herramientas. popup_init debe ser usada una
|
||||
vez hasta arriba de cada pagina donde usted planea usar la funci<63>n
|
||||
<link linkend="language.function.popup">popup</link>.
|
||||
overLib fue escrita por Erik Bosrup, y la pagina esta localizada en
|
||||
http://www.bosrup.com/web/overlib/.
|
||||
</para>
|
||||
<para>
|
||||
A partir da versión 2.1.2 de Smarty, overLib NO viene con la
|
||||
distribuci<63>n. Descargar el overLib, coloque el archivo overlib.js
|
||||
dentro de su document root e indique la ruta relativa en el par<61>metro
|
||||
"src" de popup_init.
|
||||
</para>
|
||||
<example>
|
||||
<title>popup_init</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{* popup_init debe ser llamado una sola vez hasta arriba de la pagina *}
|
||||
{popup_init src="/javascripts/overlib.js"}
|
||||
]]>
|
||||
</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
|
||||
-->
|
@@ -0,0 +1,435 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.function.popup">
|
||||
<title>popup</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>text</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Si</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>El text/html para mostrar en la ventana popup</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>trigger</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>onMouseOver</emphasis></entry>
|
||||
<entry>El que va a ser usado para que aparezca la
|
||||
ventana. Puede ser onMouseOver u onClick</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>sticky</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>false</emphasis></entry>
|
||||
<entry>Hace que el poppup se quede cerca hasta que se cierre</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>caption</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Def<EFBFBD>ne el texto para el t<>tulo</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>fgcolor</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>El color que va a ser usado dentro de la caja popup</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>bgcolor</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>El color del borde de la caja popup</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>textcolor</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Def<EFBFBD>ne el color del texto dentro de la caja popup</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>capcolor</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Def<EFBFBD>ne el color del t<>tulo de la caja</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>closecolor</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Def<EFBFBD>ne el color del texto para cerrar</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>textfont</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Def<EFBFBD>ne el color del texto para ser usado
|
||||
en el texto principal</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>captionfont</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Def<EFBFBD>ne el tipo de letra para ser usado en el T<>tulo</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>closefont</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Def<EFBFBD>ne el tipo de letra para el texto "Close"</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>textsize</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Def<EFBFBD>ne el tipo de letra del texto principal</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>captionsize</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Def<EFBFBD>ne el tama<6D>o del tipo de letra del t<>tulo</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>closesize</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Def<EFBFBD>ne el tama<6D>o del tipo de letra del texto "Close"</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>width</entry>
|
||||
<entry>integer</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Def<EFBFBD>ne el ancho de la caja</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>height</entry>
|
||||
<entry>integer</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Def<EFBFBD>ne la altura de la caja</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>left</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>false</emphasis></entry>
|
||||
<entry>Hace que el popups vaya para la izquierda del rat<61>n</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>right</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>false</emphasis></entry>
|
||||
<entry>Hace que el popups vaya para la derecha del rat<61>n</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>center</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>false</emphasis></entry>
|
||||
<entry>Hace que el popups vaya al centro del rat<61>n</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>above</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>false</emphasis></entry>
|
||||
<entry> Hace que el popups vaya por encima del
|
||||
rat<61>. NOTA:solamente es posible si el height fue definido
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>below</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>false</emphasis></entry>
|
||||
<entry>Hace que el popups vaya por abajo del rat<61>n</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>border</entry>
|
||||
<entry>integer</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Torna en gruesos o finos los bordes del popups</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>offsetx</entry>
|
||||
<entry>integer</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>A que distancia del rat<61>n aparecera el popup, horizontalmente
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>offsety</entry>
|
||||
<entry>integer</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>A que distancia del rat<61>n aparecera el popup, verticalmente
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>fgbackground</entry>
|
||||
<entry>url to image</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Def<EFBFBD>ne una imagen para usar en vez del color del popup.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>bgbackground</entry>
|
||||
<entry>url to image</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry> def<65>ne una imagen para ser usada como borde en
|
||||
vez de un color para el popup.
|
||||
NOTA:Usted debe definir bgcolor como "" o el color aparecera tambi<62>n.
|
||||
NOTA: Cuando tuviera un link "Close", el Netscape redise<73>ara las
|
||||
celdas de la tabla, haciendo que las cosas aparezcan incorrectamente
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>closetext</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Def<EFBFBD>ne el texto "Close" a otra cosa</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>noclose</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>No muestra el texto "Close" pegado con el t<>tulo</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>status</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Def<EFBFBD>ne el texto en la barra de estado del navegador </entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>autostatus</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Def<EFBFBD>ne el texto en la barra de estado para el texto del popup.
|
||||
NOTA: sobreescribe la definici<63>n del status.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>autostatuscap</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Def<EFBFBD>ne el texto de la barra de estado como el texto del t<>tulo
|
||||
NOTA: sobreescribe el status y autostatus
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>inarray</entry>
|
||||
<entry>integer</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>
|
||||
Indica al overLib desde que <20>ndice de la
|
||||
matriz ol_text debe leer el texto, localizada en overlib.js.
|
||||
Este par<61>metro puede ser usado en vez del texto
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>caparray</entry>
|
||||
<entry>integer</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Indica al overLib a partir de que <20>ndice de la
|
||||
matriz ol_caps leer el t<>tulo</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>capicon</entry>
|
||||
<entry>url</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Muestra la imagen antes del t<>tulo</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>snapx</entry>
|
||||
<entry>integer</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Instantanea el popup a una posici<63>n
|
||||
constante en una cuadricula horizontal</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>snapy</entry>
|
||||
<entry>integer</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Instantanea el popup a una posici<63>n
|
||||
constante en una cuadricula vertical</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>fixx</entry>
|
||||
<entry>integer</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Cierra el popups en una posici<63>n horizontal
|
||||
Nota: pasa por encima de otros colocados horizontal</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>fixy</entry>
|
||||
<entry>integer</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Cierra popups en posici<63>n vertical
|
||||
Note: pasa por encima de otros colocados vertical</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>background</entry>
|
||||
<entry>url</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Def<EFBFBD>ne una imagen para ser usada como fondo en
|
||||
vez de la tabla</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>padx</entry>
|
||||
<entry>integer,integer</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Rellena el fondo de la imagen con espacios en blanco
|
||||
horizontal para colocar el texto.
|
||||
Nota: este es un comando de dos par<61>metros</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>pady</entry>
|
||||
<entry>integer,integer</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Rellena el fondo de la imagen con espacios en blanco
|
||||
vertical para colocar el texto.
|
||||
Nota: este es un comando de dos par<61>metros</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>fullhtml</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Permite a usted controlar completamente el html sobre
|
||||
la figura de fondo.
|
||||
El c<>digo HTML es esperado en el atributo "text"</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>frame</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Controla popups en frames diferentes. Para mayores informes
|
||||
sobre esta funci<63>n vea la pagina de overlib</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>timeout</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>LLama especificamente a una funci<63>n javascript
|
||||
y toma el valor que retorna, como el texto que se
|
||||
va a mostrar en la ventana popup</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>delay</entry>
|
||||
<entry>integer</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Hace que el popup funcione como un tooltip.
|
||||
Este aparecera solo con un retraso en milesimas de segundo</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>hauto</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Determina autom<6F>ticamente si el popup debe
|
||||
aparecer a la izquierda o a la derecha del rat<61>n. </entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>vauto</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Determina autom<6F>ticamente si el popup debe
|
||||
aparecer abajo o arriba del rat<61>n.</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
popup es usado para crear ventanas popup con javascript.
|
||||
</para>
|
||||
<example>
|
||||
<title>popup</title>
|
||||
<programlisting>
|
||||
{* popup_init debe ser llamado una vez hasta arriba de la pagina *}
|
||||
{popup_init src="/javascripts/overlib.js"}
|
||||
|
||||
{* crea un link con una ventana popup que aparece cuando se pasa el mouse
|
||||
sobre este *}
|
||||
<A href="mypage.html" {popup text="This link takes you to my page!"}>mypage</A>
|
||||
|
||||
{* usted puede usar html, links, etc en el texto del popup *}
|
||||
<A href="mypage.html" {popup sticky=true caption="mypage contents"
|
||||
text="<UL><LI>links<LI>pages<LI>images</UL>" snapx=10 snapy=10}>mypage</A></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
|
||||
-->
|
@@ -0,0 +1,255 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.function.textformat">
|
||||
<title>textformat</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>style</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>estilo pre-definido</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>indent</entry>
|
||||
<entry>number</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>0</emphasis></entry>
|
||||
<entry>N<EFBFBD>mero de caracteres para endentar cada linea.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>indent_first</entry>
|
||||
<entry>number</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>0</emphasis></entry>
|
||||
<entry>N<EFBFBD>mero de caracteres para endentar la primera linea</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>indent_char</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>(single space)</emphasis></entry>
|
||||
<entry>El car<61>cter (o cadena de caracteres) para endentar</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>wrap</entry>
|
||||
<entry>number</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>80</emphasis></entry>
|
||||
<entry>Cuantos caracteres tendra cada linea</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>wrap_char</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>\n</emphasis></entry>
|
||||
<entry>Caracter (o cadena de caracteres) a usar para saltar cada linea
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>wrap_cut</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>false</emphasis></entry>
|
||||
<entry>Si es true, wrap saltara la linea en el car<61>cter exacto
|
||||
en vez de saltar al final de la palabra. </entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>assign</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>La variable del template que recibir<69> la salida </entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
textformat es una funci<63>n de bloque usada para formatear texto.
|
||||
B<>sicamente limpa espacios y caracteres especiales, y formatea
|
||||
los p<>rrafos cortando el texto al final de la palabra y endentando
|
||||
lineas.
|
||||
</para>
|
||||
<para>
|
||||
Usted puede definir los par<61>metros expl<70>citamente, o usar un
|
||||
estilo pre-definido.
|
||||
Actualmente el <20>nico estilo disponible es "email".
|
||||
</para>
|
||||
<example>
|
||||
<title>textformat</title>
|
||||
<programlisting>
|
||||
{textformat wrap=40}
|
||||
|
||||
This is foo.
|
||||
This is foo.
|
||||
This is foo.
|
||||
This is foo.
|
||||
This is foo.
|
||||
This is foo.
|
||||
|
||||
This is bar.
|
||||
|
||||
bar foo bar foo foo.
|
||||
bar foo bar foo foo.
|
||||
bar foo bar foo foo.
|
||||
bar foo bar foo foo.
|
||||
bar foo bar foo foo.
|
||||
bar foo bar foo foo.
|
||||
bar foo bar foo foo.
|
||||
|
||||
{/textformat}
|
||||
|
||||
SALIDA:
|
||||
|
||||
This is foo. This is foo. This is foo.
|
||||
This is foo. This is foo. This is foo.
|
||||
|
||||
This is bar.
|
||||
|
||||
bar foo bar foo foo. bar foo bar foo
|
||||
foo. bar foo bar foo foo. bar foo bar
|
||||
foo foo. bar foo bar foo foo. bar foo
|
||||
bar foo foo. bar foo bar foo foo.
|
||||
|
||||
|
||||
{textformat wrap=40 indent=4}
|
||||
|
||||
This is foo.
|
||||
This is foo.
|
||||
This is foo.
|
||||
This is foo.
|
||||
This is foo.
|
||||
This is foo.
|
||||
|
||||
This is bar.
|
||||
|
||||
bar foo bar foo foo.
|
||||
bar foo bar foo foo.
|
||||
bar foo bar foo foo.
|
||||
bar foo bar foo foo.
|
||||
bar foo bar foo foo.
|
||||
bar foo bar foo foo.
|
||||
bar foo bar foo foo.
|
||||
|
||||
{/textformat}
|
||||
|
||||
SALIDA:
|
||||
|
||||
This is foo. This is foo. This is
|
||||
foo. This is foo. This is foo. This
|
||||
is foo.
|
||||
|
||||
This is bar.
|
||||
|
||||
bar foo bar foo foo. bar foo bar foo
|
||||
foo. bar foo bar foo foo. bar foo
|
||||
bar foo foo. bar foo bar foo foo.
|
||||
bar foo bar foo foo. bar foo bar
|
||||
foo foo.
|
||||
|
||||
{textformat wrap=40 indent=4 indent_first=4}
|
||||
|
||||
This is foo.
|
||||
This is foo.
|
||||
This is foo.
|
||||
This is foo.
|
||||
This is foo.
|
||||
This is foo.
|
||||
|
||||
This is bar.
|
||||
|
||||
bar foo bar foo foo.
|
||||
bar foo bar foo foo.
|
||||
bar foo bar foo foo.
|
||||
bar foo bar foo foo.
|
||||
bar foo bar foo foo.
|
||||
bar foo bar foo foo.
|
||||
bar foo bar foo foo.
|
||||
|
||||
{/textformat}
|
||||
|
||||
SALIDA:
|
||||
|
||||
This is foo. This is foo. This
|
||||
is foo. This is foo. This is foo.
|
||||
This is foo.
|
||||
|
||||
This is bar.
|
||||
|
||||
bar foo bar foo foo. bar foo bar
|
||||
foo foo. bar foo bar foo foo. bar
|
||||
foo bar foo foo. bar foo bar foo
|
||||
foo. bar foo bar foo foo. bar foo
|
||||
bar foo foo.
|
||||
|
||||
{textformat style="email"}
|
||||
|
||||
This is foo.
|
||||
This is foo.
|
||||
This is foo.
|
||||
This is foo.
|
||||
This is foo.
|
||||
This is foo.
|
||||
|
||||
This is bar.
|
||||
|
||||
bar foo bar foo foo.
|
||||
bar foo bar foo foo.
|
||||
bar foo bar foo foo.
|
||||
bar foo bar foo foo.
|
||||
bar foo bar foo foo.
|
||||
bar foo bar foo foo.
|
||||
bar foo bar foo foo.
|
||||
|
||||
{/textformat}
|
||||
|
||||
SALIDA:
|
||||
|
||||
This is foo. This is foo. This is foo. This is foo. This is foo. This is
|
||||
foo.
|
||||
|
||||
This is bar.
|
||||
|
||||
bar foo bar foo foo. bar foo bar foo foo. bar foo bar foo foo. bar foo
|
||||
bar foo foo. bar foo bar foo foo. bar foo bar foo foo. bar foo bar foo
|
||||
foo.
|
||||
|
||||
</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
|
||||
-->
|
106
docs/es/designers/language-modifiers.xml
Normal file
106
docs/es/designers/language-modifiers.xml
Normal file
@@ -0,0 +1,106 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<chapter id="language.modifiers">
|
||||
<title>Modificadores de variables</title>
|
||||
<para>
|
||||
Los modificadores de variables pueden ser aplicados a variables,
|
||||
funciones habituales o cadenas. Para aplicar un modificador, especifique
|
||||
el valor seguido por <literal>|</literal>(pipe) y el nombre del modificador.
|
||||
Un modificador necesita par<61>metros adicionales que afetan en su funcionamento.
|
||||
Estos par<61>metros siguen al nombre del modificador y son separados por
|
||||
<literal>:</literal> (dos puntos).
|
||||
</para>
|
||||
<example>
|
||||
<title>Ejemplo de modificador</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{* Uppercase the title *}
|
||||
<h2>{$title|upper}</h2>
|
||||
|
||||
{* Truncate the topic to 40 characters use ... at the end *}
|
||||
Topic: {$topic|truncate:40:"..."}
|
||||
|
||||
{* format a literal string *}
|
||||
{"now"|date_format:"%Y/%m/%d"}
|
||||
|
||||
{* apply modifier to a custom function *}
|
||||
{mailto|upper address="me@domain.dom"}
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Si usted aplica un modificador a una matriz en lugar del valor de
|
||||
una variable, el modificador va a ser aplicado en cada uno de los
|
||||
valores de la matriz. Si usted realmente quisiera que el modificador
|
||||
funcionara en una matriz entera, debe colocar el simbolo
|
||||
<literal>@</literal> antes del nombre del modificador, as<61> como:
|
||||
<literal>{$articleTitle|@count}</literal> (esto mostrara el n<>mero de
|
||||
elementos de la matriz $articleTitle.)
|
||||
</para>
|
||||
<para>
|
||||
Los modificadores pueden ser cargados autom<6F>ticamente a partir de su
|
||||
<link linkend="variable.plugins.dir">$plugins_dir</link> (vea tambi<62>n:
|
||||
<link linkend="plugins.naming.conventions">Naming Conventions</link>)
|
||||
o pueden ser registrados explicitamente (vea:
|
||||
<link linkend="api.register.modifier">register_modifier</link>).
|
||||
Adicionalmente, todas las funciones de php pueden ser
|
||||
utilizadas como modificadores implicitamente.
|
||||
(El ejemplo <literal>@count</literal> de arriba usa actualmente la
|
||||
funci<63>n count de php y no un modificador de Smarty).
|
||||
Usar funciones de php como modificadores tiene dos peque<75>os problemas:
|
||||
Primero, algunas veces al ordenar los par<61>metros de una funci<63>n
|
||||
esto no es aconsejable (<literal>{"%2.f"|sprintf:$float}</literal>
|
||||
actualmente funciona, pero existe algo mas intuitivo
|
||||
Por ejemplo: <literal>{$float|string_format:"%2.f"}</literal>
|
||||
que es proporcionado con la distribuci<63>n de Smarty).
|
||||
Segundo: con <link linkend="variable.security">$security</link> activado,
|
||||
todas las funciones de php que sean utilizadas como modificadores deben
|
||||
ser declaradas como variables de una matriz
|
||||
<link linkend="variable.security.settings">$security_settings['MODIFIER_FUNCS']
|
||||
</link>.
|
||||
</para>
|
||||
|
||||
&designers.language-modifiers.language-modifier-capitalize;
|
||||
&designers.language-modifiers.language-modifier-count-characters;
|
||||
&designers.language-modifiers.language-modifier-cat;
|
||||
&designers.language-modifiers.language-modifier-count-paragraphs;
|
||||
&designers.language-modifiers.language-modifier-count-sentences;
|
||||
&designers.language-modifiers.language-modifier-count-words;
|
||||
&designers.language-modifiers.language-modifier-date-format;
|
||||
&designers.language-modifiers.language-modifier-default;
|
||||
&designers.language-modifiers.language-modifier-escape;
|
||||
&designers.language-modifiers.language-modifier-indent;
|
||||
&designers.language-modifiers.language-modifier-lower;
|
||||
&designers.language-modifiers.language-modifier-nl2br;
|
||||
&designers.language-modifiers.language-modifier-regex-replace;
|
||||
&designers.language-modifiers.language-modifier-replace;
|
||||
&designers.language-modifiers.language-modifier-spacify;
|
||||
&designers.language-modifiers.language-modifier-string-format;
|
||||
&designers.language-modifiers.language-modifier-strip;
|
||||
&designers.language-modifiers.language-modifier-strip-tags;
|
||||
&designers.language-modifiers.language-modifier-truncate;
|
||||
&designers.language-modifiers.language-modifier-upper;
|
||||
&designers.language-modifiers.language-modifier-wordwrap;
|
||||
|
||||
</chapter>
|
||||
|
||||
<!-- 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
|
||||
-->
|
@@ -0,0 +1,91 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.modifier.capitalize">
|
||||
<title>capitalize</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>Posicion del Parametro</entry>
|
||||
<entry>Tipo</entry>
|
||||
<entry>Requerido</entry>
|
||||
<entry>Default</entry>
|
||||
<entry>Descripci<EFBFBD>n</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>1</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>No</entry>
|
||||
<entry>false</entry>
|
||||
<entry>Este determina que palabra con digitos no debe ser convertida</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
Este es usado para convertir a mayuscula la primera letra de todas la
|
||||
palabras de una variable.
|
||||
|
||||
</para>
|
||||
<example>
|
||||
<title>capitalize</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('articleTitle', 'next x-men film, x3, delayed.');
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Donde index.tpl es:
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{$articleTitle}
|
||||
{$articleTitle|capitalize}
|
||||
{$articleTitle|capitalize:true}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Esta es la Salida:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
next x-men film, x3, delayed.
|
||||
Next X-Men Film, x3, Delayed.
|
||||
Next X-Men Film, X3, Delayed.
|
||||
]]>
|
||||
</screen>
|
||||
</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
|
||||
-->
|
@@ -0,0 +1,83 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.modifier.cat">
|
||||
<title>cat</title>
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="5">
|
||||
<colspec colname="param" align="center" />
|
||||
<colspec colname="type" align="center" />
|
||||
<colspec colname="required" align="center" />
|
||||
<colspec colname="cat" align="center" />
|
||||
<colspec colname="desc" />
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Parameter Position</entry>
|
||||
<entry>Type</entry>
|
||||
<entry>Required</entry>
|
||||
<entry>cat</entry>
|
||||
<entry>Description</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>1</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>empty</emphasis></entry>
|
||||
<entry>Este es el valor para concatenar con la variable dada.</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
Este valor es concatenado con la variable dada.
|
||||
</para>
|
||||
<example>
|
||||
<title>cat</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('articleTitle', "Psychics predict world didn't end");
|
||||
$smarty->display('index.tpl');
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Donde index.tpl es:
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{$articleTitle|cat:" yesterday."}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Salida:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Psychics predict world didn't end yesterday.
|
||||
]]>
|
||||
</screen>
|
||||
</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
|
||||
-->
|
@@ -0,0 +1,90 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.modifier.count.characters">
|
||||
<title>count_characters</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>Posici<EFBFBD>n del Parametro</entry>
|
||||
<entry>Tipo</entry>
|
||||
<entry>Requerido</entry>
|
||||
<entry>Default</entry>
|
||||
<entry>Descripci<EFBFBD>n</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>1</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>No</entry>
|
||||
<entry>false</entry>
|
||||
<entry>Este determina cuando incluir o no los espacios
|
||||
en blanco al contar.</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
Este es usado para contar el n<>mero de car<61>cteres en una variable.
|
||||
</para>
|
||||
<example>
|
||||
<title>count_characters</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('articleTitle', 'Cold Wave Linked to Temperatures.');
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Donde index.tpl es:
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{$articleTitle}
|
||||
{$articleTitle|count_characters}
|
||||
{$articleTitle|count_characters:true}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Salida:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Cold Wave Linked to Temperatures.
|
||||
29
|
||||
33
|
||||
]]>
|
||||
</screen>
|
||||
</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
|
||||
-->
|
@@ -0,0 +1,61 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.modifier.count.paragraphs">
|
||||
<title>count_paragraphs</title>
|
||||
<para>
|
||||
Este es usado para contar el n<>mero de parrafos en la variable.
|
||||
</para>
|
||||
<example>
|
||||
<title>count_paragraphs</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('articleTitle', "War Dims Hope for Peace. Child's Death Ruins
|
||||
Couple's Holiday.\n\nMan is Fatally Slain. Death Causes Loneliness, Feeling of Isolation.");
|
||||
$smarty->display('index.tpl');
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Donde index.tpl es:
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{$articleTitle}
|
||||
{$articleTitle|count_paragraphs}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Esta es la Salida:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
War Dims Hope for Peace. Child's Death Ruins Couple's Holiday.
|
||||
|
||||
Man is Fatally Slain. Death Causes Loneliness, Feeling of Isolation.
|
||||
2
|
||||
]]>
|
||||
</screen>
|
||||
</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
|
||||
-->
|
@@ -0,0 +1,60 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.modifier.count.sentences">
|
||||
<title>count_sentences</title>
|
||||
<para>
|
||||
Este es usado para contar el n<>mero de frases en la variable.
|
||||
</para>
|
||||
<example>
|
||||
<title>count_sentences</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('articleTitle', 'Two Soviet Ships Collide - One Dies. Enraged Cow Injures Farmer with Axe.');
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Donde index.tpl es:
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{$articleTitle}
|
||||
{$articleTitle|count_sentences}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Esta es la Salida:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Two Soviet Ships Collide - One Dies. Enraged Cow Injures Farmer with Axe.
|
||||
2
|
||||
]]>
|
||||
</screen>
|
||||
</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
|
||||
-->
|
@@ -0,0 +1,60 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.modifier.count.words">
|
||||
<title>count_words</title>
|
||||
<para>
|
||||
Este es usado para contar el n<>mero de palabras en la variable.
|
||||
</para>
|
||||
<example>
|
||||
<title>count_words</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('articleTitle', 'Dealers Will Hear Car Talk at Noon.');
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Donde index.tpl es:
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{$articleTitle}
|
||||
{$articleTitle|count_words}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Esta es la Salida:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Dealers Will Hear Car Talk at Noon.
|
||||
7
|
||||
]]>
|
||||
</screen>
|
||||
</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
|
||||
-->
|
@@ -0,0 +1,248 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.modifier.date.format">
|
||||
<title>date_format</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>Posici<EFBFBD>n del Parametro</entry>
|
||||
<entry>Tipo</entry>
|
||||
<entry>Requerido</entry>
|
||||
<entry>Default</entry>
|
||||
<entry>Descripci<EFBFBD>n</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>1</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry>%b %e, %Y</entry>
|
||||
<entry>Este es el formato para la fecha mostrada.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>2</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry>n/a</entry>
|
||||
<entry>Este es el default de la fecha si el valor de entrada
|
||||
es vacio.</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
Estos formatos de fecha y hora estan dentro del formato determinado
|
||||
strftime(). Las fechas pueden ser pasadas a Smarty como timestamps
|
||||
unix, timestamps mysql, o como cualquier cadena compuesta de mes dia
|
||||
a<>o (pasada por strtotime). El dise<73>ador puede usar entonces date_format
|
||||
para tener un control completo del formateo de la fecha. Si la fecha
|
||||
pasada para date_format estuviera vacia y un segundo par<61>metro fuera
|
||||
pasado, este ser<65> usado como la fecha a formatear.
|
||||
</para>
|
||||
<example>
|
||||
<title>date_format</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('yesterday', strtotime('-1 day'));
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Donde index.tpl es:
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{$smarty.now|date_format}
|
||||
{$smarty.now|date_format:"%A, %B %e, %Y"}
|
||||
{$smarty.now|date_format:"%H:%M:%S"}
|
||||
{$yesterday|date_format}
|
||||
{$yesterday|date_format:"%A, %B %e, %Y"}
|
||||
{$yesterday|date_format:"%H:%M:%S"}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Esta es la Salida:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Feb 6, 2001
|
||||
Tuesday, February 6, 2001
|
||||
14:33:00
|
||||
Feb 5, 2001
|
||||
Monday, February 5, 2001
|
||||
14:33:00
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
<para>
|
||||
date_format especificadores de conversi<73>n:
|
||||
<itemizedlist>
|
||||
<listitem><para>
|
||||
%a - nombre del d<>a de la semana abreviado de acuerdo al local actual
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%A - nombre del d<>a de la semana anterior de acuerdo al local actual
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%b - nombre del mes abreviado de acuerdo al local actual
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%B - nombre del mes anterior de acuerdo al local actual
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%c - Representaci<63>n preferencial de la fecha y hora local actual
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%C - a<>o con dos d<>gitos (o a<>o dividido por 100 y truncadopara un entero,
|
||||
intervalo de 00 a 99)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%d - d<>a del mes como un n<>mero decimal (intervalo de 00 a 31)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%D - Lo mismo que %m/%d/%y
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%e - D<>a del mes como un n<>mero decimal, un <20>nico d<>gito y precedido por un
|
||||
espacio (intervalo de 1 a 31)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%g - A<>o basado en la semana, sin el siglo [00,99]
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%G - A<>o basado en la semana, incluyendo el siglo [0000,9999]
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%h - Lo mismo que %b
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%H - Hora como un n<>mero decimal usando un rel<65>j de 24 horas (intervalo
|
||||
de 00 a 23)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%I - Hora como un n<>mero decimal usando un rel<65>j de 12 horas (intervalo
|
||||
de 01 a 12)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%j - D<>a del a<>o como um n<>mero decimal (intervalo de 001 a 366)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%k - Hora (rel<65>j de 24 horas) dig<69>tos <20>nicos que son precedidos por um
|
||||
espacio en blanco (intervalo de 0 a 23)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%l - Hora como un n<>mero decimal usando un rel<65>j de 12 horas, dig<69>tos
|
||||
<20>nicos son precedidos por un espacio en blanco (intervalo de 1 a 12)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%m - Mes como n<>mero decimal (intervalo de 01 a 12)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%M - Minuto como un n<>mero decimal
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%n - Caracter de nueva linea
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%p - Cualquiera `am' o `pm' de acuerdo con el valor de la hora dado,
|
||||
o la cadena correspondiente a la local actual
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%r - Hora con notaci<63>n a.m. y p.m.
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%R - Hora con notaci<63>n de 24 horas
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%S - Segundo como n<>mero decimal
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%t - Caracter tab
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%T - Hora actual, igual a %H:%M:%S
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%u - D<>a de la semana como un n<>mero decimal [1,7], representando
|
||||
con 1 el lunes
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%U - N<>mero de la semana del a<>o actual como un n<>mero decimal,
|
||||
comenzando con el primer domingo como primer dia de la primera semana
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%V - N<>mero de la semana del a<>o actual como n<>mero decimal de acuerdo
|
||||
con el ISO 8601:1988, intervalo de 01 a 53, en donde 1 es la primera
|
||||
semana que tenga por lo menos cuatro dias en el a<>o actual, siendo
|
||||
domingo el primer dia de la semana.
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%w - Día de la semana como decimal, siendo domingo 0
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%W - N<>mero de la semana del a<>o actual como n<>mero decimal,
|
||||
comenzando con el primer lunes como primer dia de la primera semana
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%x - Representaci<63>n preferida para la fecha local actual sin la hora
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%X - Representaci<63>n preferida de la hora local actual sin la fecha
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%y - A<>o como n<>mero decimal sin el siglo(intervalo de 00 a 99)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%Y - A<>o como n<>mero decimal incluyendo el siglo
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%Z - Zona horaria, o nombre, o abreviaci<63>n
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%% - Un car<61>cter `%'
|
||||
</para></listitem>
|
||||
</itemizedlist>
|
||||
<note>
|
||||
<title>NOTA PARA PROGRAMADORES:</title>
|
||||
<para>
|
||||
date_format es escencialmente una envoltura para la funci<63>n strftime()
|
||||
de PHP. Usted debera tener mas o menos especificadores de conversiones
|
||||
disponibles de acuerdo con la funci<63>n strftime() del sistema operacional
|
||||
en donde PHP fue compilado. Cheque en la pagina del manual de su sistema
|
||||
una lista completa de especificadores validos.
|
||||
</para>
|
||||
</note>
|
||||
</para>
|
||||
</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
|
||||
-->
|
@@ -0,0 +1,90 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.modifier.default">
|
||||
<title>default</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>Pocisi<EFBFBD>n del Parametro</entry>
|
||||
<entry>Tipo</entry>
|
||||
<entry>Requerido</entry>
|
||||
<entry>Default</entry>
|
||||
<entry>Descripci<EFBFBD>n</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>1</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>empty</emphasis></entry>
|
||||
<entry>Este es el valor por defecto para mostrar una variable
|
||||
que estuviera vacia.</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
Este es usado para definir un valor por defecto para una variable.
|
||||
Si esta variable estuviera vacia o no estuviera definida, el valor por
|
||||
defecto es mostrado. El valor por defecto es usado como argumento.
|
||||
</para>
|
||||
<example>
|
||||
<title>default</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('articleTitle', 'Dealers Will Hear Car Talk at Noon.');
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Donde index.tpl es:
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{$articleTitle|default:"no title"}
|
||||
{$myTitle|default:"no title"}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Esta es la Salida:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Dealers Will Hear Car Talk at Noon.
|
||||
no title
|
||||
]]>
|
||||
</screen>
|
||||
</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
|
||||
-->
|
@@ -0,0 +1,102 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.modifier.escape">
|
||||
<title>escape</title>
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="6">
|
||||
<colspec colname="param" align="center" />
|
||||
<colspec colname="type" align="center" />
|
||||
<colspec colname="required" align="center" />
|
||||
<colspec colname="possible" align="center" />
|
||||
<colspec colname="default" align="center" />
|
||||
<colspec colname="desc" />
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Posici<EFBFBD>n del Parametro</entry>
|
||||
<entry>Tipo</entry>
|
||||
<entry>Requerido</entry>
|
||||
<entry>Posibles Valores</entry>
|
||||
<entry>Default</entry>
|
||||
<entry>Description</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>1</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry>html,htmlall,url,quotes,hex,hexentity,javascript</entry>
|
||||
<entry>html</entry>
|
||||
<entry>Este es el formato de escape a utilizar.</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
Este es usado para escapar html, url, comillas simples para escapar una
|
||||
variable que no este escapada, escapar hex, hexentity o javascript.
|
||||
Por default, la variable html es escapada.
|
||||
</para>
|
||||
<example>
|
||||
<title>escape</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('articleTitle', "'Stiff Opposition Expected to Casketless Funeral Plan'");
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Donde index.tpl es:
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{$articleTitle}
|
||||
{$articleTitle|escape}
|
||||
{$articleTitle|escape:"html"} {* escapes & " ' < > *}
|
||||
{$articleTitle|escape:"htmlall"} {* escapes ALL html entities *}
|
||||
{$articleTitle|escape:"url"}
|
||||
{$articleTitle|escape:"quotes"}
|
||||
<a href="mailto:{$EmailAddress|escape:"hex"}">{$EmailAddress|escape:"hexentity"}</a>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Esta es la Salida:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
'Stiff Opposition Expected to Casketless Funeral Plan'
|
||||
'Stiff Opposition Expected to Casketless Funeral Plan'
|
||||
'Stiff Opposition Expected to Casketless Funeral Plan'
|
||||
'Stiff Opposition Expected to Casketless Funeral Plan'
|
||||
%27Stiff+Opposition+Expected+to+Casketless+Funeral+Plan%27
|
||||
\'Stiff Opposition Expected to Casketless Funeral Plan\'
|
||||
<a href="mailto:%62%6f%62%40%6d%65%2e%6e%65%74">bob@me.net</a>
|
||||
]]>
|
||||
</screen>
|
||||
</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
|
||||
-->
|
@@ -0,0 +1,118 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.modifier.indent">
|
||||
<title>indent</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>Posici<EFBFBD>n del Parametro</entry>
|
||||
<entry>Tipo</entry>
|
||||
<entry>requerido</entry>
|
||||
<entry>Default</entry>
|
||||
<entry>Descripci<EFBFBD>n</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>1</entry>
|
||||
<entry>integer</entry>
|
||||
<entry>No</entry>
|
||||
<entry>4</entry>
|
||||
<entry>Este def<65>ne con cuantos car<61>cteres endentar.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>2</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry>(un espacio)</entry>
|
||||
<entry>Este def<65>ne cual car<61>cter va a ser usado para endentar.</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
Esta endenta una cadena en cada linea, el default es 4.
|
||||
Como par<61>metro opcional, usted puede especificar el n<>mero de
|
||||
car<61>cteres para endentar. Como segundo par<61>metro opcional,
|
||||
usted puede especificar el car<61>cter que desea usar para endentar.
|
||||
(Use "\t" para tabs.)
|
||||
</para>
|
||||
<example>
|
||||
<title>indent</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('articleTitle', 'NJ judge to rule on nude beach.
|
||||
Sun or rain expected today, dark tonight.
|
||||
Statistics show that teen pregnancy drops off significantly after 25.');
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Donde index.tpl es:
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{$articleTitle}
|
||||
|
||||
{$articleTitle|indent}
|
||||
|
||||
{$articleTitle|indent:10}
|
||||
|
||||
{$articleTitle|indent:1:"\t"}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Esta es la Salida:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
NJ judge to rule on nude beach.
|
||||
Sun or rain expected today, dark tonight.
|
||||
Statistics show that teen pregnancy drops off significantly after 25.
|
||||
|
||||
NJ judge to rule on nude beach.
|
||||
Sun or rain expected today, dark tonight.
|
||||
Statistics show that teen pregnancy drops off significantly after 25.
|
||||
|
||||
NJ judge to rule on nude beach.
|
||||
Sun or rain expected today, dark tonight.
|
||||
Statistics show that teen pregnancy drops off significantly after 25.
|
||||
|
||||
NJ judge to rule on nude beach.
|
||||
Sun or rain expected today, dark tonight.
|
||||
Statistics show that teen pregnancy drops off significantly after 25.
|
||||
]]>
|
||||
</screen>
|
||||
</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
|
||||
-->
|
@@ -0,0 +1,60 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.modifier.lower">
|
||||
<title>lower</title>
|
||||
<para>
|
||||
Esta es usada para convertir a min<69>sculas una variable.
|
||||
</para>
|
||||
<example>
|
||||
<title>lower</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('articleTitle', 'Two Convicts Evade Noose, Jury Hung.');
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Donde index.tpl es:
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{$articleTitle}
|
||||
{$articleTitle|lower}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Esta es la Salida:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Two Convicts Evade Noose, Jury Hung.
|
||||
two convicts evade noose, jury hung.
|
||||
]]>
|
||||
</screen>
|
||||
</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
|
||||
-->
|
@@ -0,0 +1,59 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.modifier.nl2br">
|
||||
<title>nl2br</title>
|
||||
<para>
|
||||
Todos los saltos de linea seran convertidos a etiquetas <br /> como
|
||||
datos de la variable. Esto equivale a la funci<63>n nl2br() de PHP.
|
||||
</para>
|
||||
<example>
|
||||
<title>nl2br</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('articleTitle', "Sun or rain expected\ntoday, dark tonight");
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Donde index.tpl es:
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{$articleTitle|nl2br}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Esta es la Salida:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Sun or rain expected<br />today, dark tonight
|
||||
]]>
|
||||
</screen>
|
||||
</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
|
||||
-->
|
@@ -0,0 +1,98 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.modifier.regex.replace">
|
||||
<title>regex_replace</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>Posici<EFBFBD>n del Parametro</entry>
|
||||
<entry>Tipo</entry>
|
||||
<entry>requerido</entry>
|
||||
<entry>Default</entry>
|
||||
<entry>Descripci<EFBFBD>n</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>1</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Si</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Esta es la expresi<73>n regular a ser substituida.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>2</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Si</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Esta es la cadena que sustituira a la expresi<73>n regular.</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
Localiza una expresi<73>n regular y la remplaza en la variable.
|
||||
Use la sintaxis para preg_replace() del manual de PHP.
|
||||
</para>
|
||||
<example>
|
||||
<title>regex_replace</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('articleTitle', "Infertility unlikely to\nbe passed on, experts say.");
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Donde index.tpl es:
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{* replace each carriage return, tab and new line with a space *}
|
||||
|
||||
{$articleTitle}
|
||||
{$articleTitle|regex_replace:"/[\r\t\n]/":" "}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Esta es la Salida:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Infertility unlikely to
|
||||
be passed on, experts say.
|
||||
Infertility unlikely to be passed on, experts say.
|
||||
]]>
|
||||
</screen>
|
||||
</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
|
||||
-->
|
@@ -0,0 +1,96 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.modifier.replace">
|
||||
<title>replace</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>Posici<EFBFBD>n del Parametro</entry>
|
||||
<entry>Tipo</entry>
|
||||
<entry>Requerido</entry>
|
||||
<entry>Default</entry>
|
||||
<entry>Descripci<EFBFBD>n</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>1</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Si</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Esta es la cadena a ser substituida.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>2</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Si</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Esta es la cadena que ira a substituir.</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
Una simple busqueda y substituir en la variable.
|
||||
</para>
|
||||
<example>
|
||||
<title>replace</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('articleTitle', "Child's Stool Great for Use in Garden.");
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Donde index.tpl es:
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{$articleTitle}
|
||||
{$articleTitle|replace:"Garden":"Vineyard"}
|
||||
{$articleTitle|replace:" ":" "}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Esta es la Salida:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Child's Stool Great for Use in Garden.
|
||||
Child's Stool Great for Use in Vineyard.
|
||||
Child's Stool Great for Use in Garden.
|
||||
]]>
|
||||
</screen>
|
||||
</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
|
||||
-->
|
@@ -0,0 +1,88 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.modifier.spacify">
|
||||
<title>spacify</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>Posici<EFBFBD>n del Parametro</entry>
|
||||
<entry>Tipo</entry>
|
||||
<entry>Requerido</entry>
|
||||
<entry>Default</entry>
|
||||
<entry>Descripci<EFBFBD>n</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>1</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>one space</emphasis></entry>
|
||||
<entry>Este se inserta entre cada car<61>cter de la variable.</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
Inserta un espacio entre cada car<61>cter de una variable. Usted puede
|
||||
opcionalmente pasar un car<61>cter (o una cadena) diferente para insertar.
|
||||
</para>
|
||||
<example>
|
||||
<title>spacify</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('articleTitle', 'Something Went Wrong in Jet Crash, Experts Say.');
|
||||
$smarty->display('index.tpl');
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Donde index.tpl es:
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{$articleTitle}
|
||||
{$articleTitle|spacify}
|
||||
{$articleTitle|spacify:"^^"}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Esta es la Salida:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Something Went Wrong in Jet Crash, Experts Say.
|
||||
S o m e t h i n g W e n t W r o n g i n J e t C r a s h , E x p e r t s S a y .
|
||||
S^^o^^m^^e^^t^^h^^i^^n^^g^^ ^^W^^e^^n^^t^^ ^^W^^r^^o^^n^^g^^ ^^i^^n^^ ^^J^^e^^t^^ ^^C^^r^^a^^s^^h^^,^^ ^^E^^x^^p^^e^^r^^t^^s^^ ^^S^^a^^y^^.
|
||||
]]>
|
||||
</screen>
|
||||
</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
|
||||
-->
|
@@ -0,0 +1,90 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.modifier.string.format">
|
||||
<title>string_format</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>Posici<EFBFBD>n del Parametro</entry>
|
||||
<entry>Tipo</entry>
|
||||
<entry>Requerido</entry>
|
||||
<entry>Default</entry>
|
||||
<entry>Descripci<EFBFBD>n</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>1</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Si</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Este es el formato que debera usar. (sprintf)</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
Esta es una manera de formatear cadenas, como n<>meros decimales y otros.
|
||||
Use la sintaxis de sprintf para formatearlo.
|
||||
</para>
|
||||
<example>
|
||||
<title>string_format</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('number', 23.5787446);
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Donde index.tpl es:
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{$number}
|
||||
{$number|string_format:"%.2f"}
|
||||
{$number|string_format:"%d"}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Esta es la Salida:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
23.5787446
|
||||
23.58
|
||||
24
|
||||
]]>
|
||||
</screen>
|
||||
</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
|
||||
-->
|
@@ -0,0 +1,91 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.modifier.strip.tags">
|
||||
<title>strip_tags</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>Posici<EFBFBD>n del Parametro</entry>
|
||||
<entry>Tipo</entry>
|
||||
<entry>Requerido</entry>
|
||||
<entry>Default</entry>
|
||||
<entry>descripci<EFBFBD>n</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>1</entry>
|
||||
<entry>bool</entry>
|
||||
<entry>No</entry>
|
||||
<entry>true</entry>
|
||||
<entry>Este determina cuando las etiquetas seran remplazadas por ' '
|
||||
o por ''</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
Este retira las etiquetas de marcaci<63>n, basicamente todo entre < y >.
|
||||
</para>
|
||||
<example>
|
||||
<title>strip_tags</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('articleTitle', "Blind Woman Gets <font face=\"helvetica\">New
|
||||
Kidney</font> from Dad she Hasn't Seen in <b>years</b>.");
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Donde index.tpl es:
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{$articleTitle}
|
||||
{$articleTitle|strip_tags} {* same as {$articleTitle|strip_tags:true} *}
|
||||
{$articleTitle|strip_tags:false}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Esta es la Salida:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Blind Woman Gets <font face="helvetica">New Kidney</font> from Dad she Hasn't Seen in <b>years</b>.
|
||||
Blind Woman Gets New Kidney from Dad she Hasn't Seen in years .
|
||||
Blind Woman Gets New Kidney from Dad she Hasn't Seen in years.
|
||||
]]>
|
||||
</screen>
|
||||
</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
|
||||
-->
|
@@ -0,0 +1,71 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.modifier.strip">
|
||||
<title>strip</title>
|
||||
<para>
|
||||
Este substituye todos los espacios repetidos, nuevas lineas y tabs
|
||||
por un unico espacio u otra cadena indicada.
|
||||
</para>
|
||||
<note>
|
||||
<title>Nota</title>
|
||||
<para>
|
||||
Si usted quiere substituir bloques de texto de un template use la
|
||||
funci<63>n <link linkend="language.function.strip">strip</link>.
|
||||
</para>
|
||||
</note>
|
||||
<example>
|
||||
<title>strip</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('articleTitle', "Grandmother of\neight makes\t hole in one.");
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Donde index.tpl es:
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{$articleTitle}
|
||||
{$articleTitle|strip}
|
||||
{$articleTitle|strip:" "}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Esta es la Salida:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Grandmother of
|
||||
eight makes hole in one.
|
||||
Grandmother of eight makes hole in one.
|
||||
Grandmother of eight makes hole in one.
|
||||
]]>
|
||||
</screen>
|
||||
</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
|
||||
-->
|
@@ -0,0 +1,119 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.modifier.truncate">
|
||||
<title>truncate</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>Posici<EFBFBD>n del Parametro</entry>
|
||||
<entry>Tipo</entry>
|
||||
<entry>Requerido</entry>
|
||||
<entry>Default</entry>
|
||||
<entry>Desdcripci<EFBFBD>n</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>1</entry>
|
||||
<entry>integer</entry>
|
||||
<entry>No</entry>
|
||||
<entry>80</entry>
|
||||
<entry>Este determina para cuantos car<61>cteres truncar.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>2</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry>...</entry>
|
||||
<entry>Este es el texto para adicionar si el truncamiento ocurre.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>3</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>No</entry>
|
||||
<entry>false</entry>
|
||||
<entry>Este determina cuando truncar o no o al final de una
|
||||
palabra(false), o un car<61>cter exacto(true).
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
Este trunca la variable en una cantidad de cacarteres, el default es 80.
|
||||
Como segundo par<61>metro opcional, usted puede especificar una cadena
|
||||
para mostrar al final si la variable fue truncada. Los car<61>cteres en la
|
||||
cadena son incluidos tamando el original para el truncamiento.
|
||||
Por default, truncate intentara cortar al final de una palabra.
|
||||
Se usted quisiera cortar una cantidad exacta de car<61>cteres, pase el
|
||||
tercer par<61>metro, que es opcional, como true.
|
||||
</para>
|
||||
<example>
|
||||
<title>truncate</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('articleTitle', 'Two Sisters Reunite after Eighteen Years at Checkout Counter.');
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Donde index.tpl es:
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{$articleTitle}
|
||||
{$articleTitle|truncate}
|
||||
{$articleTitle|truncate:30}
|
||||
{$articleTitle|truncate:30:""}
|
||||
{$articleTitle|truncate:30:"---"}
|
||||
{$articleTitle|truncate:30:"":true}
|
||||
{$articleTitle|truncate:30:"...":true}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Esta es la Salida:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Two Sisters Reunite after Eighteen Years at Checkout Counter.
|
||||
Two Sisters Reunite after Eighteen Years at Checkout Counter.
|
||||
Two Sisters Reunite after...
|
||||
Two Sisters Reunite after
|
||||
Two Sisters Reunite after---
|
||||
Two Sisters Reunite after Eigh
|
||||
Two Sisters Reunite after E...
|
||||
]]>
|
||||
</screen>
|
||||
</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
|
||||
-->
|
@@ -0,0 +1,60 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.modifier.upper">
|
||||
<title>upper</title>
|
||||
<para>
|
||||
Este es usado para convertir a mayusculas una variable.
|
||||
</para>
|
||||
<example>
|
||||
<title>upper</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('articleTitle', "If Strike isn't Settled Quickly it may Last a While.");
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Donde index.tpl es:
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{$articleTitle}
|
||||
{$articleTitle|upper}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Esta es la Salida:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
If Strike isn't Settled Quickly it may Last a While.
|
||||
IF STRIKE ISN'T SETTLED QUICKLY IT MAY LAST A WHILE.
|
||||
]]>
|
||||
</screen>
|
||||
</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
|
||||
-->
|
@@ -0,0 +1,132 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.modifier.wordwrap">
|
||||
<title>wordwrap</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>Posici<EFBFBD>n del Parametro</entry>
|
||||
<entry>Tipo</entry>
|
||||
<entry>Requerido</entry>
|
||||
<entry>Default</entry>
|
||||
<entry>Descripci<EFBFBD>n</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>1</entry>
|
||||
<entry>integer</entry>
|
||||
<entry>No</entry>
|
||||
<entry>80</entry>
|
||||
<entry>Este determina en cuantas columnas cortar.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>2</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry>\n</entry>
|
||||
<entry>Esta es la cadena usada para cortar.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>3</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>No</entry>
|
||||
<entry>false</entry>
|
||||
<entry>Este determina cuando cortar o no, o al final de una
|
||||
palabra(false), o en un car<61>cter exacto(true).
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
Este corta una cadena para un ancho de columna, el default es 80.
|
||||
Como segundo par<61>metro opcional, usted puede especificar la cadena
|
||||
que ser<65> usada para cortar el texto para la pr<70>xima linea (el default
|
||||
es un retorno de carro \n).
|
||||
Por default, wordwrap intentara cortar al final de una palabra. Si
|
||||
usted quisiera cortar un tama<6D>o exacto de cacarteres, pase al
|
||||
tercer par<61>metro, que es opcional, como true.
|
||||
</para>
|
||||
<example>
|
||||
<title>wordwrap</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('articleTitle', "Blind woman gets new kidney from dad she hasn't seen in years.");
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Donde index.tpl es:
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{$articleTitle}
|
||||
|
||||
{$articleTitle|wordwrap:30}
|
||||
|
||||
{$articleTitle|wordwrap:20}
|
||||
|
||||
{$articleTitle|wordwrap:30:"<br />\n"}
|
||||
|
||||
{$articleTitle|wordwrap:30:"\n":true}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Esta es la Salida:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Blind woman gets new kidney from dad she hasn't seen in years.
|
||||
|
||||
Blind woman gets new kidney
|
||||
from dad she hasn't seen in
|
||||
years.
|
||||
|
||||
Blind woman gets new
|
||||
kidney from dad she
|
||||
hasn't seen in
|
||||
years.
|
||||
|
||||
Blind woman gets new kidney<br />
|
||||
from dad she hasn't seen in<br />
|
||||
years.
|
||||
|
||||
Blind woman gets new kidney
|
||||
from dad she hasn't seen in
|
||||
years.
|
||||
]]>
|
||||
</screen>
|
||||
</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
|
||||
-->
|
51
docs/es/designers/language-variables.xml
Normal file
51
docs/es/designers/language-variables.xml
Normal file
@@ -0,0 +1,51 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<chapter id="language.variables">
|
||||
<title>Variables</title>
|
||||
<para>
|
||||
Smarty tiene varios tipos diferentes de variables. El tipo de variable
|
||||
depende de cual simbolo este prefijado(incluido dentro).
|
||||
</para>
|
||||
<para>
|
||||
Las variables de Smarty no pueden ser mostradas directamente o usadas
|
||||
como argumentos para atributos de funciones y modificadores, dentro de
|
||||
expresiones condicionales, etc. Para mostrar una variable, simplesmente
|
||||
coloque esta entre delimitadores siendo esta la <20>nica cosa entre ellos.
|
||||
Ejemplos:
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{$Name}
|
||||
|
||||
{$Contacts[row].Phone}
|
||||
|
||||
<body bgcolor="{#bgcolor#}">
|
||||
]]>
|
||||
</programlisting>
|
||||
</para>
|
||||
|
||||
&designers.language-variables.language-assigned-variables;
|
||||
&designers.language-variables.language-config-variables;
|
||||
&designers.language-variables.language-variables-smarty;
|
||||
|
||||
</chapter>
|
||||
|
||||
<!-- 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
|
||||
-->
|
@@ -0,0 +1,175 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.assigned.variables">
|
||||
<title>Variables definidas desde PHP</title>
|
||||
<para>
|
||||
Las variables que son definidas desde PHP son referenciadas precedendo
|
||||
estas con una se<73>al de cifrado <literal>$</literal>. Las variables
|
||||
definidas dentro del template como una funci<63>n
|
||||
<link linkend="language.function.assign">assign</link> tambi<62>n son
|
||||
mostradas de esta manera.
|
||||
</para>
|
||||
<example>
|
||||
|
||||
<title>variables definidas</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
Hello {$firstname}, glad to see you could make it.
|
||||
<br />
|
||||
Your last login was on {$lastLoginDate}.
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
This will output:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Hello Doug, glad to see you could make it.
|
||||
<br />
|
||||
Your last login was on January 11th, 2001.
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
|
||||
<sect2 id="language.variables.assoc.arrays">
|
||||
<title>Arreglos asociativos</title>
|
||||
<para>
|
||||
Usted tambi<62>n puede referenciar matrices asociativas en variables
|
||||
que son definidas desde PHP especificando la clave despu<70>s del
|
||||
simbolo '.'(punto).
|
||||
</para>
|
||||
<example>
|
||||
<title>Accesando variables de matriz asociativa</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('Contacts',
|
||||
array('fax' => '555-222-9876',
|
||||
'email' => 'zaphod@slartibartfast.com',
|
||||
'phone' => array('home' => '555-444-3333',
|
||||
'cell' => '555-111-1234')));
|
||||
$smarty->display('index.tpl');
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
where the content of index.tpl is:
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{$Contacts.fax}<br />
|
||||
{$Contacts.email}<br />
|
||||
{* you can print arrays of arrays as well *}
|
||||
{$Contacts.phone.home}<br />
|
||||
{$Contacts.phone.cell}<br />
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
this will output:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
555-222-9876<br />
|
||||
zaphod@slartibartfast.com<br />
|
||||
555-444-3333<br />
|
||||
555-111-1234<br />
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</sect2>
|
||||
<sect2 id="language.variables.array.indexes">
|
||||
<title><EFBFBD>ndices de Matrices</title>
|
||||
<para>
|
||||
Usted podra referencia matrizes por su <20>ndice, muy semejantes a la
|
||||
sintaxis de PHP.
|
||||
</para>
|
||||
<example>
|
||||
<title>Accesando matrices por sus <20>ndices</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('Contacts',
|
||||
array('555-222-9876',
|
||||
'zaphod@slartibartfast.com',
|
||||
array('555-444-3333',
|
||||
'555-111-1234')));
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
where index.tpl is:
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{$Contacts[0]}<br />
|
||||
{$Contacts[1]}<br />
|
||||
{* you can print arrays of arrays as well *}
|
||||
{$Contacts[2][0]}<br />
|
||||
{$Contacts[2][1]}<br />
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
This will output:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
555-222-9876<br />
|
||||
zaphod@slartibartfast.com<br />
|
||||
555-444-3333<br />
|
||||
555-111-1234<br />
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</sect2>
|
||||
<sect2 id="language.variables.objects">
|
||||
<title>Objetos</title>
|
||||
<para>
|
||||
Las propiedades de los objetos definidos desde PHP pueden ser
|
||||
referenciados especificando el nombre de la propiedad despu<70>;s
|
||||
del simbolo '->'.
|
||||
</para>
|
||||
<example>
|
||||
<title>Accesando propiedades de objetos</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
name: {$person->name}<br />
|
||||
email: {$person->email}<br />
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
this will output:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
name: Zaphod Beeblebrox<br />
|
||||
email: zaphod@slartibartfast.com<br />
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</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
|
||||
-->
|
@@ -0,0 +1,114 @@
|
||||
<?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>
|
||||
Las variables que son cargadas de archivos de configuraci<63>n son
|
||||
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>
|
||||
index.tpl: (alternate syntax)
|
||||
</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>
|
||||
this will output for both examples:
|
||||
</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
|
||||
<command>config_load</command>.
|
||||
</para>
|
||||
</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
|
||||
-->
|
@@ -0,0 +1,165 @@
|
||||
<?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
|
||||
-->
|
546
docs/es/getting-started.xml
Normal file
546
docs/es/getting-started.xml
Normal file
@@ -0,0 +1,546 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<part id="getting.started">
|
||||
<title>Iniciando</title>
|
||||
|
||||
<chapter id="what.is.smarty">
|
||||
<title>Que es Smarty?</title>
|
||||
<para>
|
||||
Smarty es un motor de plantillas para PHP. Mas especificamente, esta
|
||||
herramienta facilita la manera de separar la aplicaci<63>n l<>gica y el
|
||||
contenido en la presentaci<63>n.
|
||||
La mejor descripci<63>n esta en una situaci<63>n donde la aplicaci<63>n
|
||||
del programador y la plantilla del dise<73>ador juegan diferentes roles,
|
||||
o en la mayoria de los casos no la misma persona. Por ejemplo:
|
||||
Digamos que usted crea una pagina web, es decir, despliega el articulo
|
||||
de un diario. El encabezado del articulo, el rotulo, el autor y el
|
||||
cuerpo son elementos del contenido, estos no contiene informaci<63>n de
|
||||
como quieren ser presentados. Estos son pasados por la aplicaci<63>n
|
||||
Smarty, donde el dise<73>ador edita la plantilla, y usa una combinaci<63>n de
|
||||
etiquetas HTML y etiquetas de plantilla para formatear la presentaci<63>n
|
||||
de estos elementos (HTML, tablas, color de fondo, tama<6D>o de letras,
|
||||
hojas de estilo, etc...).
|
||||
Un d<>a el programador necesita cambiar la manera de recuperar el
|
||||
contenido del articulo(un cambio en la aplicaci<63>n l<>gica.). Este
|
||||
cambio no afectara al dise<73>ador de la plantilla, el contenido llegara a
|
||||
la plantilla exactamente igual. De la misma manera, si el dise<73>ador de
|
||||
la plantilla quiere redise<73>arla en su totalidad, estos cambios no
|
||||
afectaran la aplicaci<63>n l<>gica.
|
||||
Por lo tanto, el programador puede hacer cambios en la aplicaci<63>n l<>gica
|
||||
sin que sea necesario restructurar la plantilla. Y el dise<73>ador de la
|
||||
plantilla puede hacer cambios sin que haya rompimiento con la aplicaci<63>n
|
||||
l<>gica.
|
||||
</para>
|
||||
<para>
|
||||
Ahora un peque<75>o resumen sobre que no hace Smarty. Smarty no intenta
|
||||
separar completamente la l<>gica de la plantilla. No hay problema entre la
|
||||
l<>gica y su plantilla bajo la condici<63>n que esta l<>gica sea
|
||||
estrictamente para presentaci<63>n.
|
||||
Un consejo: mantener la aplicaci<63>n l<>gica fuera de la plantilla, y la
|
||||
presentaci<63>n fuera de la aplicaci<63>n l<>gica.
|
||||
Esto tiene como finalidad tener un objeto mas manipulable y escalable para
|
||||
un futuro proximo.
|
||||
</para>
|
||||
<para>
|
||||
Un <20>nico aspecto acerca de Smarty es la compilaci<63>n de la plantilla.
|
||||
De esta manera Smarty lee la plantilla y crea los scripts de PHP. Una vez
|
||||
creados, son executados sobre <20>l.
|
||||
Por consiguiente no existe ning<6E>n costo por analizar gramaticalmente
|
||||
cada archivo de template por cada requisici<63>n, y cada template puede llevar
|
||||
toda la ventaja del compilador de cache de PHP tal como Zend Accelerator
|
||||
(<ulink url="&url.zend;">&url.zend;</ulink>) o PHP Accelerator
|
||||
(<ulink url="&url.php-accelerator;">&url.php-accelerator;</ulink>).
|
||||
</para>
|
||||
<para>
|
||||
Algunas de las caracter<65>sticas de Smarty:
|
||||
</para>
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>
|
||||
Es extremamente r<>pido.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
Es eficiente ya que puede interpretar el trabajo mas sucio.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
No analiza gramaticalmente desde arriba el template, solo compila una vez.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
El esta atento para solo recompilar los archivos de plantilla que fueron
|
||||
cambiados.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
Usted puede crear <link linkend="language.custom.functions">
|
||||
funciones habituales </link>
|
||||
y <link linkend="language.modifiers">modificadores de variables </link>
|
||||
customizados, de modo que el lenguaje de la platilla es altamente extensible.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
Sintaxis de etiquetas delimitadoras para configuraci<63>n de la plantilla,
|
||||
as<61> lo puede usar {}, {{}}, <!--{}-->, etc.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
Los construtoress if/elseif/else/endif son pasados por el interpretador
|
||||
de PHP, as<61> la sintaxis de la expresi<73>n {if ...} puede ser compleja o
|
||||
simple de la forma que usted quiera.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
Permite un anidamiento ilimitado de sections, ifs, etc.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
Es posible incrustar directamente codigo PHP en los archivos de plantilla,
|
||||
aunque esto puede no ser necesario(no recomendado) dado que la herramienta
|
||||
se puede ajustar.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
Soporte de caching incrustado
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
Fuentes de Plantilla absoluto
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
Funciones habituales de manipulaci<63>n de cache
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
Arquitectura de Plugin
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</chapter>
|
||||
<chapter id="installation">
|
||||
<title>Instalaci<EFBFBD>n</title>
|
||||
|
||||
<sect1 id="installation.requirements">
|
||||
<title>Requerimentos</title>
|
||||
<para>
|
||||
Smarty Requiere un servidor web corriendo PHP 4.0.6 o posterior.
|
||||
</para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="installing.smarty.basic">
|
||||
<title>Instalaci<EFBFBD>n B<>sica</title>
|
||||
<para>
|
||||
Instale los archivos de la libreria de Smarty que estan en el directorio
|
||||
de distribuci<63>n /libs/.
|
||||
Estos son los archivos PHP que usted NO EDITARA. Estos archivos son toda
|
||||
las aplicaciones comunes y ellos son actualizados cuando usted actualiza
|
||||
a una nueva versi<73>n de Smarty.
|
||||
</para>
|
||||
<example>
|
||||
<title>Archivos de la libreria Smarty</title>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Smarty.class.php
|
||||
Smarty_Compiler.class.php
|
||||
Config_File.class.php
|
||||
debug.tpl
|
||||
/core/*.php (all of them)
|
||||
/plugins/*.php (all of them)
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
<para>
|
||||
Smarty utiliza una constante de PHP llamada <link
|
||||
linkend="constant.smarty.dir">SMARTY_DIR</A> que es la ruta para
|
||||
el directorio de la biblioteca de Smarty. Basicamente, si su
|
||||
aplicaci<63>n puede encontrar el archivo <emphasis>Smarty.class.php
|
||||
</emphasis>, usted no necesita definir SMARTY_DIR, Smarty lo
|
||||
encontrar<61>. Por consiguiente si, <emphasis>Smarty.class.php
|
||||
</emphasis> no esta incluido en el path, y no es abastecido por
|
||||
una ruta absoluta para encontrar su aplicaci<63>n, entonces usted
|
||||
debe definir SMARTY_DIR manualmente. SMARTY_DIR <emphasis>debe
|
||||
</emphasis> incluir una barra de seguimento.
|
||||
</para>
|
||||
<para>
|
||||
Aqu<71> esta un ejemplo de como se crea una instancia de Smarty en sus
|
||||
scripts PHP:
|
||||
</para>
|
||||
|
||||
<example>
|
||||
<title>Creando una instancia Smarty de Smarty</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
require('Smarty.class.php');
|
||||
$smarty = new Smarty;
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
<para>
|
||||
Intente correr el script de arriba. Si usted obtiene un error diciendo que
|
||||
el archivo <emphasis>Smarty.class.php</emphasis>
|
||||
no fue encontrado, puedes usar una de las siguientes opciones:
|
||||
</para>
|
||||
|
||||
<example>
|
||||
<title>Reemplazar por la ruta absulta de la libreria del archivo</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
require('/usr/local/lib/php/Smarty/Smarty.class.php');
|
||||
$smarty = new Smarty;
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
<example>
|
||||
<title>Adicionar el directorio de la libreria para incluirlo en el
|
||||
include_path de PHP</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
// Edite su archivo php.ini, y adicione el directorio de la
|
||||
// biblioteca de Smarty
|
||||
// include_path y reinicie su servidor web.
|
||||
// Entonces lo siguiente debe funcionar:
|
||||
|
||||
require('Smarty.class.php');
|
||||
$smarty = new Smarty;
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
<example>
|
||||
<title>Defina la constante SMARTY_DIR manualmente</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
define('SMARTY_DIR', '/usr/local/lib/php/Smarty/');
|
||||
require(SMARTY_DIR . 'Smarty.class.php');
|
||||
$smarty = new Smarty;
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
<para>
|
||||
Ahora que la libreria de archivos esta en su sitio, es tiempo
|
||||
de configurar los directorios de Smarty para su aplicaci<63>n.
|
||||
Smarty require cuatro directorios (por defaul) llamados
|
||||
<emphasis>templates</emphasis>, <emphasis>templates_c</emphasis>,
|
||||
<emphasis>configs</emphasis> y <emphasis>cache</emphasis>. Cada
|
||||
uno de estos son para definir las propiedades de las clases de Smarty.
|
||||
<emphasis>$template_dir</emphasis>, <emphasis>$compile_dir</emphasis>,
|
||||
<emphasis>$config_dir</emphasis>, y <emphasis>$cache_dir</emphasis>
|
||||
respectivamente. Es altamente recomendado que usted configure un grupo
|
||||
separado de estos directorios para cada aplicaci<63>n que utilice de Smarty.
|
||||
</para>
|
||||
<para>
|
||||
Asegurece que usted sabe la ubicaci<63>n del document root de su servidor
|
||||
web. En nuestro ejemplo, el document root esta en
|
||||
"/web/www.mydomain.com/docs/". Los directorios de Smarty solo son
|
||||
accesados por la libreria de Smarty y nunca son accesados directamente
|
||||
por el navegador. Por consiguiente para evitar cualquier preocupaci<63>n
|
||||
con la seguridad, es recomendado colocar estos directorios
|
||||
<emphasis> fuera </emphasis> del document root.
|
||||
</para>
|
||||
<para>
|
||||
Para nuestro ejemplo de instalaci<63>n, configuraremos el ambiente de Smarty
|
||||
para una aplicaci<63>n de libro de visitas. Escojemos una aplicaci<63>n solo
|
||||
con el proposito de crear un directorio de nombre convencional.
|
||||
Usted puede usar el mismo ambiente para cualquier aplicaci<63>n, solamente
|
||||
sustituya "guestbook" con el nombre de su aplicaci<63>n.
|
||||
Nosotros colocaremos nuestros directorios de Smarty dentro de
|
||||
"/web/www.mydomain.com/smarty/guestbook/".
|
||||
</para>
|
||||
<para>
|
||||
Usted necesita tener por lo menos un archivo dentro de su document root,
|
||||
y que sea accesado por el navegador. Nosotros llamamos el script de
|
||||
"index.php", y lo colocamos en un subdirectorio dentro del document root
|
||||
llamado "/guestbook/".
|
||||
</para>
|
||||
|
||||
<note>
|
||||
<title>Nota T<>cnica: </title>
|
||||
<para>
|
||||
Es conveniente configurar el servidor de forma que "index.php" pueda
|
||||
ser identificado como el <20>ndice del direct<63>rio padre, de esta manera
|
||||
si usted accesa "http://www.mydomain.com/guestbook/", el script
|
||||
index.php ser<65> ejecutado sin "index.php" ni la URL.
|
||||
En Apache usted puede definir el sitio adicionando "index.php" en el
|
||||
final de su configuraci<63>n del directorio index
|
||||
(separando cada uno con espacios.)
|
||||
</para>
|
||||
</note>
|
||||
|
||||
<para>
|
||||
Veamos nuestra estructura de archivos hasta hora:
|
||||
</para>
|
||||
|
||||
<example>
|
||||
<title>Ejemplo de estrutura de archivo</title>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
/usr/local/lib/php/Smarty/Smarty.class.php
|
||||
/usr/local/lib/php/Smarty/Smarty_Compiler.class.php
|
||||
/usr/local/lib/php/Smarty/Config_File.class.php
|
||||
/usr/local/lib/php/Smarty/debug.tpl
|
||||
/usr/local/lib/php/Smarty/core/*.php
|
||||
/usr/local/lib/php/Smarty/plugins/*.php
|
||||
|
||||
/web/www.mydomain.com/smarty/guestbook/templates/
|
||||
/web/www.mydomain.com/smarty/guestbook/templates_c/
|
||||
/web/www.mydomain.com/smarty/guestbook/configs/
|
||||
/web/www.mydomain.com/smarty/guestbook/cache/
|
||||
|
||||
/web/www.mydomain.com/docs/guestbook/index.php
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
|
||||
<para>
|
||||
Smarty necesitara permisos de escritura para
|
||||
<emphasis>$compile_dir</emphasis> y <emphasis>$cache_dir</emphasis>,
|
||||
esto garantiza que el usuario del servidor pueda escribir en ellos.
|
||||
Este es generalmente el usuarios "nobody" y el grupo "nobody".
|
||||
Para X usuarios de sistema, el default es "www" y el grupo "www".
|
||||
Si usted esta usando Apache, puede ver en su archivo httpd.conf
|
||||
(normalmente en "/usr/local/apache/conf/") cual es el usuario y
|
||||
grupo que estan siendo usados.
|
||||
</para>
|
||||
|
||||
<example>
|
||||
<title>Configurando permisos de archivos</title>
|
||||
<programlisting role="shell">
|
||||
<![CDATA[
|
||||
chown nobody:nobody /web/www.mydomain.com/smarty/guestbook/templates_c/
|
||||
chmod 770 /web/www.mydomain.com/smarty/guestbook/templates_c/
|
||||
|
||||
chown nobody:nobody /web/www.mydomain.com/smarty/guestbook/cache/
|
||||
chmod 770 /web/www.mydomain.com/smarty/guestbook/cache/
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
<note>
|
||||
<title>Nota T<>cnica: </title>
|
||||
<para>
|
||||
chmod 770 puede ser una seguridad bastante fuerte, solo le permite al
|
||||
usuario "nobody" y al grupo "nobody" acesso de lectura/escritura a los
|
||||
directorios. Si usted quiere abrir permiso de lectura a cualquiera
|
||||
(en la mayoria de las veces para su propia conveniencia de querer ver
|
||||
estos archivos), usted puede usar el 775 en lugar del 770.
|
||||
</para>
|
||||
</note>
|
||||
|
||||
<para>
|
||||
Nosotros necesitamos crear el archivo index.tpl, para que Smarty lo
|
||||
pueda cargar. Este estara localizado en su $template_dir.
|
||||
</para>
|
||||
|
||||
<example>
|
||||
<title>Editando /web/www.mydomain.com/smarty/guestbook/templates/index.tpl</title>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
|
||||
{* Smarty *}
|
||||
|
||||
Hello, {$name}!
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
|
||||
<note>
|
||||
<title>Nota T<>cnica:</title>
|
||||
<para>
|
||||
{* Smarty *} Esto es un comentario en el template.
|
||||
Este no es obligatorio, pero si una buena practica iniciar todos sus
|
||||
archivos de plantilla con estos comentarios.
|
||||
Esto hace facilmente reconocibles a los archivos a pesar la extenci<63>n
|
||||
del archivo. Por ejemplo, editores de texto pueden reconocer el archivo
|
||||
y habilitar un realce de sintaxis especial.
|
||||
</para>
|
||||
</note>
|
||||
|
||||
<para>
|
||||
Ahora vamos a editar el index.php. crearemos una instancia de Smarty,
|
||||
daremos valor a las variables del template y mostraremos el archivo
|
||||
index.tpl.
|
||||
En el ambiente de nuestro ejemplo, "/usr/local/lib/php/Smarty" esta
|
||||
dentro de include_path. Asegurese que exista el mismo, o utilice la
|
||||
ruta absoluta.
|
||||
</para>
|
||||
|
||||
<example>
|
||||
<title>Editando /web/www.mydomain.com/docs/guestbook/index.php</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
// load Smarty library
|
||||
require('Smarty.class.php');
|
||||
|
||||
$smarty = new Smarty;
|
||||
|
||||
$smarty->template_dir = '/web/www.mydomain.com/smarty/guestbook/templates/';
|
||||
$smarty->compile_dir = '/web/www.mydomain.com/smarty/guestbook/templates_c/';
|
||||
$smarty->config_dir = '/web/www.mydomain.com/smarty/guestbook/configs/';
|
||||
$smarty->cache_dir = '/web/www.mydomain.com/smarty/guestbook/cache/';
|
||||
|
||||
$smarty->assign('name','Ned');
|
||||
|
||||
$smarty->display('index.tpl');
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
<note>
|
||||
<title>Nota T<>cnica: </title>
|
||||
<para>
|
||||
En nuestro ejemplo, estamos configurando rutas absolutas para todos
|
||||
los directorios de Smarty.
|
||||
Si '/web/www.mydomain.com/smarty/guestbook/' est<73> dentro de su
|
||||
include_path de PHP, entonces estas declaraciones no son necesarias.
|
||||
Sin embargo, esto es mas eficiente y (por experiencia) tiene menos
|
||||
tendencia a errores en relaci<63>n a determinar las rutas absolutas.
|
||||
Esto garantiza que Smarty esta recibiendo los archivos del directorio
|
||||
que usted desea.
|
||||
</para>
|
||||
</note>
|
||||
|
||||
<para>
|
||||
Ahora carge el archivo index.php desde su navegador web. Usted debera
|
||||
ver "Hello, Ned!"
|
||||
</para>
|
||||
<para>
|
||||
Usted a completado la configuracion basica para el Smarty!
|
||||
</para>
|
||||
</sect1>
|
||||
<sect1 id="installing.smarty.extended">
|
||||
<title>Expandiendo la configuraci<63>n</title>
|
||||
|
||||
<para>
|
||||
Esta es una continuaci<63>n de la <link linkend="installing.smarty.basic">
|
||||
instalaci<63>n b<>sica</link>, por favor lea esta primero!
|
||||
</para>
|
||||
<para>
|
||||
Una forma un poco mas flexible de configurar el Smarty, expandir las
|
||||
clases e iniciar su ambiente de Smarty. Es, en vez de configurar rutas
|
||||
de directorios repetidamente, asigne esas mismas a variables, etc.,
|
||||
nosotros podemos facilitar eso. Vamos a crear un nuevo directorio en
|
||||
"/php/includes/guestbook/" y llamemos al nuevo archivo "setup.php".
|
||||
En nuestro ejemplo, "/php/includes" est<73> en nuestro include_path.
|
||||
Verifique que usted tambi<62>n lo definio, o utilice rutas absolutas de
|
||||
los archivos.
|
||||
</para>
|
||||
|
||||
<example>
|
||||
<title>Editando /php/includes/guestbook/setup.php</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
// load Smarty library
|
||||
require('Smarty.class.php');
|
||||
|
||||
// The setup.php file is a good place to load
|
||||
// required application library files, and you
|
||||
// can do that right here. An example:
|
||||
// require('guestbook/guestbook.lib.php');
|
||||
|
||||
class Smarty_GuestBook extends Smarty {
|
||||
|
||||
function Smarty_GuestBook()
|
||||
{
|
||||
|
||||
// Class Constructor. These automatically get set with each new instance.
|
||||
|
||||
$this->Smarty();
|
||||
|
||||
$this->template_dir = '/web/www.mydomain.com/smarty/guestbook/templates/';
|
||||
$this->compile_dir = '/web/www.mydomain.com/smarty/guestbook/templates_c/';
|
||||
$this->config_dir = '/web/www.mydomain.com/smarty/guestbook/configs/';
|
||||
$this->cache_dir = '/web/www.mydomain.com/smarty/guestbook/cache/';
|
||||
|
||||
$this->caching = true;
|
||||
$this->assign('app_name','Guest Book');
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
<para>
|
||||
Ahora vamos a modificar el archivo index.php para usar el setup.php:
|
||||
</para>
|
||||
|
||||
<example>
|
||||
<title>Editando /web/www.mydomain.com/docs/guestbook/index.php</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
require('guestbook/setup.php');
|
||||
|
||||
$smarty = new Smarty_GuestBook;
|
||||
|
||||
$smarty->assign('name','Ned');
|
||||
|
||||
$smarty->display('index.tpl');
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
<para>
|
||||
Ahora usted vera que es completamente simple crear una instancia de
|
||||
Smarty, solo use Smarty_GuestBook, que autom<6F>ticamente inicializa todo
|
||||
para nuestra aplicaci<63>n.
|
||||
</para>
|
||||
|
||||
</sect1>
|
||||
|
||||
</chapter>
|
||||
</part>
|
||||
|
||||
<!-- 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
|
||||
-->
|
103
docs/es/preface.xml
Normal file
103
docs/es/preface.xml
Normal file
@@ -0,0 +1,103 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<preface id="preface">
|
||||
<title>Pr<EFBFBD>logo</title>
|
||||
<para>
|
||||
Esta es indudablemente una de las preguntas que mas se hacen en las listas
|
||||
de correo de PHP: Como hacer mis scripts de PHP independientes del dise<73>o?.
|
||||
Mientras PHP se encarga de como "incrustar scripts en lenguaje HTML",
|
||||
despu<70>s de escribir los proyectos que mezclan PHP y HTML libremente,
|
||||
esto trae como consecuencia la idea de separar la forma y el contenido,
|
||||
muy buena idea[TM]. En adici<63>n, en muchas compa<70>ias la
|
||||
interpretaci<63>n de esquema es dise<73>ador y programador por separado.
|
||||
Por consiguiente, la busqueda trae como soluci<63>n una plantilla(template).
|
||||
</para>
|
||||
<para>
|
||||
Por ejemplo en nuestra compa<70>ia, el desarrollo de una aplicaci<63>n es
|
||||
como sigue: Despu<70>s de tener la documentaci<63>n necesaria, el
|
||||
dise<73>ador de web dise<73>a el prototipo de la interfaz y la entrega al
|
||||
programador. El programador implementa las reglas de negocio en PHP y usa el
|
||||
prototipo para crear el "esqueleto" de la plantilla.
|
||||
El proyeto esta en manos de la persona responsable del HTML designer/web page
|
||||
que produzca la plantilla para su gloria completa. El proyecto debe ir y regresar
|
||||
entre programaci<63>n/HTML varias veces. De esa manera, es importante para
|
||||
tener un buen suporte de templates porque los programadores no quieren hacer nada
|
||||
con HTML ni quieren dise<73>o HTML al rededor del codigo PHP.
|
||||
Los dise<73>adores precisan de soporte para archivos de configuraci<63>n, bloques
|
||||
din<69>micos y otras interfaces usadas, mas ellos no quieren ocuparse con las
|
||||
compejidades del lenguaje de programaci<63>n PHP.
|
||||
</para>
|
||||
<para>
|
||||
Buscando, actualmente existen muchas soluciones de templates disponibles para
|
||||
PHP, la mayor parte de ellos les provee de una forma rudimentaria de
|
||||
sustituci<63>n de variables dentro del template y hace una forma limitada
|
||||
de la funcionalidad din<69>mica del bloque.
|
||||
Pero nuestras necesidades requieren mas que eso.
|
||||
Porque no queremos programadores que no quieran tener trato con HTML del todo,
|
||||
pero esto puede ser casi inevitable.
|
||||
Por ejemplo, si un dise<73>ador quiere alternar colores de fondo sobre bloques
|
||||
din<69>micos, esto tuvo que trabajarse con el programador anticipadamente.
|
||||
Nosotros necesitamos tambi<62>n que los dise<73>adores esten capacitados para
|
||||
usar archivos de configuraci<63>n, y colocar variables de ellos dentro de
|
||||
los templates. La lista continua.
|
||||
</para>
|
||||
<para>
|
||||
Nosotros empezamos escribiendo por fuera una especulaci<63>n para un
|
||||
motor de plantillas(templates) atrasado de 1999.
|
||||
Despu<70>s de terminar la especulaci<63>n, comenzamos a trabajar
|
||||
un motor de plantillas escrito en C que esperanzadoramente fue aceptado
|
||||
para ser incorporado con PHP.
|
||||
No solamente nos encontramos con algunas complicadas barreras tecnicas,
|
||||
si no tambi<62>n hubo acalorados debates sobre lo que exactamente
|
||||
debia de hacer o no un motor de plantillas.
|
||||
De esta experiencia, decidimos que un motor de platillas dever<65>a
|
||||
ser escrito en PHP como una clase, para que cualquiera lo use de la misma
|
||||
forma como ellos ven.
|
||||
As<41> nosotros escribimos un motor que es <productname>SmartTemplate
|
||||
</productname> nunca volvio a existir(nota: esa clase nunca fue
|
||||
enviada al p<>blico). Esta era una clase que ralizaba casi todo lo que nosotros
|
||||
necesitabamos: sustituci<63>n de variables regulares, soporte incluso
|
||||
de otras plantillas, integraci<63>n con archivos de configuraci<63>n,
|
||||
incrustaci<63>n de c<>digo PHP, funcionalidades 'if' limitada y muchos
|
||||
mas bloques din<69>micos robustos que podr<64>an ser anidados muchas veces.
|
||||
Todo esto con expresiones regulares y el c<>digo producido seria mejor, como
|
||||
diriamos nosotros, impenetrable.
|
||||
Eso era tambi<62>n notoriamente lento en grandes aplicaciones por todas
|
||||
las interpretaciones y expresiones regulares trabajando en cada
|
||||
requisici<63>n.
|
||||
El mayor problema del punto de vista de un programador era todo el trabajo
|
||||
necesario en el procesamiento del scripts PHP y procesamiento de bloques
|
||||
din<69>micos de la plantilla. Como hacemos eso facilmente?
|
||||
</para>
|
||||
<para>
|
||||
Entonces se origino la visi<73>n de que finalmente se convirtiera en
|
||||
Smarty. Nosotros sabemos que r<>pido es el c<>digo PHP sin las cabeceras
|
||||
y la interpretaci<63>n de plantillas(templates).
|
||||
Tambi<62>n sabemos que meticuloso y arrogante es el lenguaje PHP su poder
|
||||
debe ser aceptable para un dise<73>ador, y este podr<64>a ser enmascarado con
|
||||
una simples sintaxis de plantillas(templates).
|
||||
Entonces que pasara si nosotros convinamos las dos fuerzas?
|
||||
De esta manera, nacio Smarty...
|
||||
</para>
|
||||
</preface>
|
||||
|
||||
<!-- 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
|
||||
-->
|
35
docs/es/programmers/advanced-features.xml
Normal file
35
docs/es/programmers/advanced-features.xml
Normal file
@@ -0,0 +1,35 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<chapter id="advanced.features">
|
||||
<title>Caracteristicas Avanzadas</title>
|
||||
&programmers.advanced-features.advanced-features-objects;
|
||||
&programmers.advanced-features.advanced-features-prefilters;
|
||||
|
||||
&programmers.advanced-features.advanced-features-postfilters;
|
||||
|
||||
&programmers.advanced-features.advanced-features-outputfilters;
|
||||
|
||||
&programmers.advanced-features.section-template-cache-handler-func;
|
||||
|
||||
&programmers.advanced-features.template-resources;
|
||||
</chapter>
|
||||
<!-- 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
|
||||
-->
|
@@ -0,0 +1,117 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="advanced.features.objects">
|
||||
<title>Objetos</title>
|
||||
<para>
|
||||
El Smarty permite acceso a objetos de PHP a trav<61>s de sus templates.
|
||||
Hay dos formas de accesarlos. Una forma es registrando objetos para el
|
||||
template, entonces acceselos mediante sintaxis similar a las funciones
|
||||
habituales. La otra es asignar objetos al template y accesarlos como si
|
||||
fueran una variable asignada. El primer m<>todo tiene una sintaxis de
|
||||
template mucho mas agradable. Y tambi<62>n mas segura, a medida que un
|
||||
objeto registrado puede ser reescrito a ciertos m<>todos y propiedades.
|
||||
Sin embargo tanto, un objeto registrado no puede ser puesto en loop o
|
||||
ser asignado en arreglos de objetos, etc. El m<>todo que usted escoja
|
||||
sera determinado por sus necesidades, pero utilice el primero m<>todo si
|
||||
es posible para mantener un minimo de sintaxis en el template.
|
||||
</para>
|
||||
<para>
|
||||
Si la seguridad esta habilitada, ninguno de los dos m<>todos privados o
|
||||
funciones pueden ser accesados (comenzando con "_"). Si un metodo y
|
||||
propiedades de un mismo nombre existe, el m<>todo ser<65> usado.
|
||||
</para>
|
||||
<para>
|
||||
Usted puede restringir los m<>todos y propiedades que pueden ser accesados
|
||||
listandolos en un arreglo como el tercer par<61>metro de registro.
|
||||
</para>
|
||||
<para>
|
||||
Por default, los par<61>metros pasados a los objetos a a trav<61>s de los
|
||||
templates son pasados de la misma forma en que las funciones de
|
||||
costumbre los obtienen. Un arreglo asociativo es pasado como el primer
|
||||
par<61>metro, y el objeto smarty como el segundo. Si usted quiere que los
|
||||
par<61>metros pasados uno de cada vez por cada argumento pasen como
|
||||
par<61>metros de un objeto tradicional, defina el cuarto par<61>metro de
|
||||
registro en falso.
|
||||
</para>
|
||||
<para>
|
||||
El quinto par<61>metro opcional solo tiene efecto con
|
||||
<parameter>format</parameter> siendo <literal>true</literal>
|
||||
y conteniendo una lista de m<>todos de ob que seran tratados
|
||||
como bloques. Esto significa que estos m<>todos tienen una
|
||||
etiqueta de cierre en el template
|
||||
(<literal>{foobar->meth2}...{/foobar->meth2}</literal>) y
|
||||
los par<61>metros para los m<>todos tienen la misma sinopsis como
|
||||
los par<61>metros de block-function-plugins: Ellos reciben 4
|
||||
par<61>metros <parameter>$params</parameter>,
|
||||
<parameter>$content</parameter>,<parameter>&$smarty</parameter>
|
||||
y <parameter>&$repeat</parameter> tambi<62>n se comportan como
|
||||
block-function-plugins.
|
||||
</para>
|
||||
<example>
|
||||
<title>usando un objeto registrado o atribuido</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
// El objeto
|
||||
|
||||
class My_Object {
|
||||
function meth1($params, &$smarty_obj) {
|
||||
return "this is my meth1";
|
||||
}
|
||||
}
|
||||
|
||||
$myobj = new My_Object;
|
||||
|
||||
// registrando el objeto (ser<65> por referencia)
|
||||
$smarty->register_object("foobar",$myobj);
|
||||
|
||||
// Si usted quiere restringir acceso a ciertos metodos o propriedades,
|
||||
// listelos
|
||||
$smarty->register_object("foobar",$myobj,array('meth1','meth2','prop1'));
|
||||
|
||||
// Si usted quiere usar el formato de parámetro del objeto tradicional,
|
||||
// pase un booleano en false
|
||||
$smarty->register_object("foobar",$myobj,null,false);
|
||||
|
||||
// también puede asignar ojetos. Posible cuando se asignan por
|
||||
// referencia.
|
||||
$smarty->assign_by_ref("myobj", $myobj);
|
||||
|
||||
$smarty->display("index.tpl");
|
||||
?>
|
||||
|
||||
TEMPLATE:
|
||||
|
||||
{* accesando a nuestro objeto registrado *}
|
||||
{foobar->meth1 p1="foo" p2=$bar}
|
||||
|
||||
{* usted tambi<62>n puede asignar la salida *}
|
||||
{foobar->meth1 p1="foo" p2=$bar assign="output"}
|
||||
the output was {$output}
|
||||
|
||||
{* accesando a nuestro objeto asignado *}
|
||||
{$myobj->meth1("foo",$bar)}
|
||||
]]>
|
||||
</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
|
||||
-->
|
@@ -0,0 +1,69 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="advanced.features.outputfilters">
|
||||
<title>Filtros de salida</title>
|
||||
<para>
|
||||
Cuando el template es invocado a trav<61>s de display() o fetch(),
|
||||
su salida puede ser enviada a trav<61>s de uno o mas filtros de salida.
|
||||
Este es diferente a los postfilters porque los postfilters operan en
|
||||
los templates compilados antes de ser salvados en disco, y los filtros
|
||||
de salida operan en la salida del template cuando este es ejecutado.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Los Filtros de Salida pueden ser
|
||||
<link linkend="api.register.outputfilter">registrado</link> o
|
||||
cargados del directorio de plugins usando la funci<63>n
|
||||
<link linkend="api.load.filter">load_filter()</link> o
|
||||
configurando a variable
|
||||
<link linkend="variable.autoload.filters">$autoload_filters</link>.
|
||||
El Smarty pasara la salida como el primer argumento, y espera
|
||||
que la funci<63>n retorne el resultado del procesamiento.
|
||||
</para>
|
||||
<example>
|
||||
<title>Usando un filtro de salida de template</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
// ponga esto en su aplicaci<63>n
|
||||
|
||||
function protect_email($tpl_output, &$smarty)
|
||||
{
|
||||
$tpl_output =
|
||||
preg_replace('!(\S+)@([a-zA-Z0-9\.\-]+\.([a-zA-Z]{2,3}|[0-9]{1,3}))!',
|
||||
'$1%40$2', $tpl_output);
|
||||
return $tpl_output;
|
||||
}
|
||||
|
||||
// registra el outputfilter
|
||||
$smarty->register_outputfilter("protect_email");
|
||||
$smarty->display("index.tpl");
|
||||
|
||||
// Ahora cualquier ocurrencia de una dirección de email en la salida
|
||||
// del template tendra una simple protección contra spambots
|
||||
|
||||
?>
|
||||
]]>
|
||||
</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
|
||||
-->
|
@@ -0,0 +1,59 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="advanced.features.postfilters">
|
||||
<title>Postfilters</title>
|
||||
<para>
|
||||
Los postfilters de template son funciones de PHP con las cuales sus
|
||||
templates son corridos inmediatamente despu<70>s de ser compilados.
|
||||
Los postfilters pueden ser <link linkend="api.register.postfilter">
|
||||
registrado</link> o cargados del directorio de plugins usando la funci<63>n
|
||||
<link linkend="api.load.filter">load_filter()</link> o por la variable
|
||||
de configuraci<63>n
|
||||
<link linkend="variable.autoload.filters">$autoload_filters</link>.
|
||||
El Smarty pasara el c<>digo fuente del template
|
||||
compilado como el primer argumento, y espera que la funci<63>n retorne el
|
||||
resultado del procesamiento.
|
||||
</para>
|
||||
<example>
|
||||
<title>Usando un postfilter de template</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
// ponga esto en su aplicación
|
||||
function add_header_comment($tpl_source, &$smarty)
|
||||
{
|
||||
return "<?php echo \"<!-- Created by Smarty! -->;\n\" ?>;\n".$tpl_source;
|
||||
}
|
||||
|
||||
// registra el postfilter
|
||||
$smarty->register_postfilter("add_header_comment");
|
||||
$smarty->display("index.tpl");
|
||||
?>
|
||||
|
||||
{* compiled Smarty template index.tpl *}
|
||||
<!-- Created by Smarty! -->
|
||||
{* rest of template content... *}
|
||||
]]>
|
||||
</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
|
||||
-->
|
@@ -0,0 +1,61 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="advanced.features.prefilters">
|
||||
<title>Prefilters</title>
|
||||
<para>
|
||||
Los prefilters de Template son funciones de PHP que corren sus
|
||||
templates antes de ser compilados. Esto es bueno para procesar
|
||||
por adelantado sus templates y remover comentarios no deseados,
|
||||
vigilando a las personas que coloquen en sus templates, etc.
|
||||
Los Prefilters pueden ser
|
||||
<link linkend="api.register.prefilter">registrado</link>
|
||||
o cargado del directorio de plugins usando la funci<63>n
|
||||
<link linkend="api.load.filter">load_filter()</link> o por la
|
||||
configuraci<63>n de la variable
|
||||
<link linkend="variable.autoload.filters">$autoload_filters</link>.
|
||||
El Smarty pasara el c<>digo fuente del template como el primer argumento,
|
||||
y espera que la funci<63>n le retorne el c<>digo fuente del template
|
||||
resultante.
|
||||
</para>
|
||||
<example>
|
||||
<title>usando un prefiltro prefilter de template</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
// ponga esto en su aplicaci<63>n
|
||||
function remove_dw_comments($tpl_source, &$smarty)
|
||||
{
|
||||
return preg_replace("/<!--#.*-->/U","",$tpl_source);
|
||||
}
|
||||
|
||||
// registrar el prefilter
|
||||
$smarty->register_prefilter("remove_dw_comments");
|
||||
$smarty->display("index.tpl");
|
||||
?>
|
||||
|
||||
{* Smarty template index.tpl *}
|
||||
<!--# esta linea ser<65> eliminada por el prefilter -->
|
||||
]]>
|
||||
</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
|
||||
-->
|
@@ -0,0 +1,158 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="section.template.cache.handler.func">
|
||||
<title>Funci<EFBFBD>n manipuladora de cache</title>
|
||||
<para>
|
||||
Como una alternativa al uso del mecanismo de caching por default
|
||||
basado en archivo, usted puede especificar una funci<63>n habitual
|
||||
de manipulaci<63>n de cache que ser<65> usada para leer, escribir y
|
||||
limpar archivos de cache.
|
||||
</para>
|
||||
<para>
|
||||
Cree una funci<63>n en su aplicaci<63>n para que Smarty la use como un
|
||||
manipulador de cache. Defina el nombre de la variable de clase en el
|
||||
<link linkend="variable.cache.handler.func">$cache_handler_func</link>.
|
||||
El Smarty ahora usara esta para manipular datos en el cache. El primer
|
||||
par<61>metro es la acci<63>n, que puede ser uno de estos 'read', 'write' y
|
||||
'clear'. El segundo par<61>metro es el objeto de Smarty. El tercer par<61>metro
|
||||
es el contenido que esta en el cache. Sobre 'write', el Smarty pasa el
|
||||
contenido en cache en estos par<61>metros. sobre 'read', el Smarty espera
|
||||
que su funci<63>n acepte este par<61>metro por referencia y poblar estos con los
|
||||
datos en cache. Sobre 'clear', el Smarty pasa una variable en cero desde
|
||||
aqu<71> que esta no es usada. El cuarto par<61>metro es el nombre del archivo de
|
||||
template(necesario para leer/escribir). El quinto par<61>metro es la cache_id
|
||||
(opcional). El sexto par<61>metro es la compile_id (opcional).
|
||||
</para>
|
||||
<para>
|
||||
NOTA: El ultimo par<61>metro ($exp_time) fue adicionado en el Smarty-2.6.0.
|
||||
</para>
|
||||
<example>
|
||||
<title> ejemplo usando MySQL como una fuente de cache</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
/*
|
||||
|
||||
ejemplo de uso:
|
||||
|
||||
include('Smarty.class.php');
|
||||
include('mysql_cache_handler.php');
|
||||
|
||||
$smarty = new Smarty;
|
||||
$smarty->cache_handler_func = 'mysql_cache_handler';
|
||||
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
|
||||
mysql database is expected in this format:
|
||||
|
||||
create database SMARTY_CACHE;
|
||||
|
||||
create table CACHE_PAGES(
|
||||
CacheID char(32) PRIMARY KEY,
|
||||
CacheContents MEDIUMTEXT NOT NULL
|
||||
);
|
||||
|
||||
*/
|
||||
|
||||
function mysql_cache_handler($action, &$smarty_obj, &$cache_content, $tpl_file=null, $cache_id=null, $compile_id=null, $exp_time=null)
|
||||
{
|
||||
// set db host, user and pass here
|
||||
$db_host = 'localhost';
|
||||
$db_user = 'myuser';
|
||||
$db_pass = 'mypass';
|
||||
$db_name = 'SMARTY_CACHE';
|
||||
$use_gzip = false;
|
||||
|
||||
// create unique cache id
|
||||
$CacheID = md5($tpl_file.$cache_id.$compile_id);
|
||||
|
||||
if(! $link = mysql_pconnect($db_host, $db_user, $db_pass)) {
|
||||
$smarty_obj->_trigger_error_msg("cache_handler: could not connect to database");
|
||||
return false;
|
||||
}
|
||||
mysql_select_db($db_name);
|
||||
|
||||
switch ($action) {
|
||||
case 'read':
|
||||
// read cache from database
|
||||
$results = mysql_query("select CacheContents from CACHE_PAGES where CacheID='$CacheID'");
|
||||
if(!$results) {
|
||||
$smarty_obj->_trigger_error_msg("cache_handler: query failed.");
|
||||
}
|
||||
$row = mysql_fetch_array($results,MYSQL_ASSOC);
|
||||
|
||||
if($use_gzip && function_exists("gzuncompress")) {
|
||||
$cache_contents = gzuncompress($row["CacheContents"]);
|
||||
} else {
|
||||
$cache_contents = $row["CacheContents"];
|
||||
}
|
||||
$return = $results;
|
||||
break;
|
||||
case 'write':
|
||||
// save cache to database
|
||||
|
||||
if($use_gzip && function_exists("gzcompress")) {
|
||||
// compress the contents for storage efficiency
|
||||
$contents = gzcompress($cache_content);
|
||||
} else {
|
||||
$contents = $cache_content;
|
||||
}
|
||||
$results = mysql_query("replace into CACHE_PAGES values(
|
||||
'$CacheID',
|
||||
'".addslashes($contents)."')
|
||||
");
|
||||
if(!$results) {
|
||||
$smarty_obj->_trigger_error_msg("cache_handler: query failed.");
|
||||
}
|
||||
$return = $results;
|
||||
break;
|
||||
case 'clear':
|
||||
// clear cache info
|
||||
if(empty($cache_id) && empty($compile_id) && empty($tpl_file)) {
|
||||
// clear them all
|
||||
$results = mysql_query("delete from CACHE_PAGES");
|
||||
} else {
|
||||
$results = mysql_query("delete from CACHE_PAGES where CacheID='$CacheID'");
|
||||
}
|
||||
if(!$results) {
|
||||
$smarty_obj->_trigger_error_msg("cache_handler: query failed.");
|
||||
}
|
||||
$return = $results;
|
||||
break;
|
||||
default:
|
||||
// error, unknown action
|
||||
$smarty_obj->_trigger_error_msg("cache_handler: unknown action \"$action\"");
|
||||
$return = false;
|
||||
break;
|
||||
}
|
||||
mysql_close($link);
|
||||
return $return;
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
]]>
|
||||
</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
|
||||
-->
|
239
docs/es/programmers/advanced-features/template-resources.xml
Normal file
239
docs/es/programmers/advanced-features/template-resources.xml
Normal file
@@ -0,0 +1,239 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="template.resources">
|
||||
<title>Recursos</title>
|
||||
<para>
|
||||
Los templates pueden venir de una variedad de fuentes. Cuando usted
|
||||
muestra un template con (display) o (fetch), o incluye un template
|
||||
dentro de otro template, usted suministra un tipo de recurso, seguido
|
||||
por la ruta correcta y el nombre del template.
|
||||
Si un recurso no es dado explicitamente el valor de
|
||||
<link linkend="variable.default.resource.type">$default_resource_type</link>
|
||||
es asumido.
|
||||
</para>
|
||||
<sect2 id="templates.from.template.dir">
|
||||
<title>Templates partiendo del $template_dir</title>
|
||||
<para>
|
||||
Los templates desde el $template_dir no requieren recursos del
|
||||
template, aunque usted puede usar el file: resource for
|
||||
consistancy(recurso por consistencia). Justamente proporcionando
|
||||
la ruta(path) del template que usted quiere usar en relaci<63>n al
|
||||
directorio root $template_dir.
|
||||
</para>
|
||||
<example>
|
||||
<title>Usando templates partiendo del $template_dir</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
// desde el script de PHP
|
||||
$smarty->display("index.tpl");
|
||||
$smarty->display("admin/menu.tpl");
|
||||
$smarty->display("file:admin/menu.tpl"); // agual al de arriba
|
||||
?>
|
||||
|
||||
{* dentro del template de Smarty *}
|
||||
{include file="index.tpl"}
|
||||
{include file="file:index.tpl"} {* igual al de arriba *}
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</sect2>
|
||||
<sect2 id="templates.from.any.dir">
|
||||
<title>Templates partiendo de cualquier directorio</title>
|
||||
<para>
|
||||
Los templates de fuera del $template_dir requieren el file: tipo
|
||||
de recurso del template, seguido por la ruta absoluta y el nombre
|
||||
del template.
|
||||
</para>
|
||||
<example>
|
||||
<title>usando templates partiendo de cualquier directorio</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
// desde el script de PHP
|
||||
$smarty->display("file:/export/templates/index.tpl");
|
||||
$smarty->display("file:/path/to/my/templates/menu.tpl");
|
||||
?>
|
||||
|
||||
{* desde adentro del template Smarty *}
|
||||
{include file="file:/usr/local/share/templates/navigation.tpl"}
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
<sect3 id="templates.windows.filepath">
|
||||
<title>Rutas de archivos de Windows</title>
|
||||
<para>
|
||||
Si usted esta utilizando una maquina con windows, las rutas de
|
||||
los archivos normalmente incluyen la letra del drive (C:) en el
|
||||
comienzo del nombre de la ruta. Asegurarse de usar "file:" en la
|
||||
ruta para evitar conflictos de nombres y poder obtener los
|
||||
resultados desados.
|
||||
</para>
|
||||
<example>
|
||||
<title>usando templates con rutas de archivos de windows</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
// dentro del script de PHP
|
||||
$smarty->display("file:C:/export/templates/index.tpl");
|
||||
$smarty->display("file:F:/path/to/my/templates/menu.tpl");
|
||||
?>
|
||||
|
||||
{* dentro del template de Smarty *}
|
||||
{include file="file:D:/usr/local/share/templates/navigation.tpl"}
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</sect3>
|
||||
</sect2>
|
||||
|
||||
<sect2 id="templates.from.elsewhere">
|
||||
<title>Templates partiendo de otras fuentes</title>
|
||||
<para>
|
||||
Se pueden retomar templates usando cualquier fuente posible a la
|
||||
que usted pueda acceder con PHP: base de datos, sockets, LDAP, etc.
|
||||
Usted puede hacer esto escribiendo las funciones de plugin de recurso
|
||||
y registrandolas con Smarty.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Vea la secci<63>n <link linkend="plugins.resources">resource plugins</link>
|
||||
para mayor informacion sobre las funciones que puede utilizar.
|
||||
</para>
|
||||
|
||||
<note>
|
||||
<para>
|
||||
Nota Usted puede activar manualmente el recurso <literal>file</literal>
|
||||
incrustado, pero no puede suministrar un recurso que busca templates a
|
||||
partir del sistema de archivos de alguna otra forma registrando bajo
|
||||
otro nombre de recurso.
|
||||
</para>
|
||||
</note>
|
||||
<example>
|
||||
<title>Usando recursos habituales</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
// ponga estas funciones en algun lugar de su aplicaci<63>n
|
||||
function db_get_template ($tpl_name, &$tpl_source, &$smarty_obj)
|
||||
{
|
||||
// ejecutar la base de datos madar llamar aqu<71> su template,
|
||||
// poblando el $tpl_source
|
||||
|
||||
$sql = new SQL;
|
||||
$sql->query("select tpl_source
|
||||
from my_table
|
||||
where tpl_name='$tpl_name'");
|
||||
if ($sql->num_rows) {
|
||||
$tpl_source = $sql->record['tpl_source'];
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function db_get_timestamp($tpl_name, &$tpl_timestamp, &$smarty_obj)
|
||||
{
|
||||
// ejecutar la base de datos llamar aqu<71> para poblar
|
||||
// $tpl_timestamp.
|
||||
$sql = new SQL;
|
||||
$sql->query("select tpl_timestamp
|
||||
from my_table
|
||||
where tpl_name='$tpl_name'");
|
||||
if ($sql->num_rows) {
|
||||
$tpl_timestamp = $sql->record['tpl_timestamp'];
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function db_get_secure($tpl_name, &$smarty_obj)
|
||||
{
|
||||
// asume que todos los templates son seguros
|
||||
return true;
|
||||
}
|
||||
|
||||
function db_get_trusted($tpl_name, &$smarty_obj)
|
||||
{
|
||||
// no usar para templates
|
||||
}
|
||||
|
||||
// registrar el nombre del recurso "db"
|
||||
$smarty->register_resource("db", array("db_get_template",
|
||||
"db_get_timestamp",
|
||||
"db_get_secure",
|
||||
"db_get_trusted"));
|
||||
|
||||
// usando el recurso a partir del script PHP
|
||||
$smarty->display("db:index.tpl");
|
||||
?>
|
||||
|
||||
{* usando el recurso dentro del template de Smarty *}
|
||||
{include file="db:/extras/navigation.tpl"}
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</sect2>
|
||||
|
||||
<sect2 id="default.template.handler.function">
|
||||
<title>Funci<EFBFBD>n manipuladora de Template por default</title>
|
||||
<para>
|
||||
Usted puede especificar la funci<63>n que ser<65> usada para devolver
|
||||
el contenido del template dentro del evento del template no puede
|
||||
ser retomado desde su recurso. Un uso distinto es para crear
|
||||
templates que no existen "on-the-fly" (templates cuyo contenido
|
||||
cambia mucho, bastante variable).
|
||||
</para>
|
||||
<example>
|
||||
<title> usando la funci<63>n manipuladora de template por default</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
// ponga esta función en algun lugar de su aplicación
|
||||
|
||||
function make_template ($resource_type, $resource_name, &$template_source, &$template_timestamp, &$smarty_obj)
|
||||
{
|
||||
if( $resource_type == 'file' ) {
|
||||
if ( ! is_readable ( $resource_name )) {
|
||||
// create the template file, return contents.
|
||||
$template_source = "This is a new template.";
|
||||
$template_timestamp = time();
|
||||
$smarty_obj->_write_file($resource_name,$template_source);
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
// not a file
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// defina la función manipuladora por default
|
||||
$smarty->default_template_handler_func = 'make_template';
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</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
|
||||
-->
|
72
docs/es/programmers/api-functions.xml
Normal file
72
docs/es/programmers/api-functions.xml
Normal file
@@ -0,0 +1,72 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<reference id="api.functions">
|
||||
<title>Metodos</title>
|
||||
<titleabbrev></titleabbrev>
|
||||
<partintro>
|
||||
<section>
|
||||
<title />
|
||||
<para></para>
|
||||
</section>
|
||||
</partintro>
|
||||
&programmers.api-functions.api-append;
|
||||
&programmers.api-functions.api-append-by-ref;
|
||||
&programmers.api-functions.api-assign;
|
||||
&programmers.api-functions.api-assign-by-ref;
|
||||
&programmers.api-functions.api-clear-all-assign;
|
||||
&programmers.api-functions.api-clear-all-cache;
|
||||
&programmers.api-functions.api-clear-assign;
|
||||
&programmers.api-functions.api-clear-cache;
|
||||
&programmers.api-functions.api-clear-compiled-tpl;
|
||||
&programmers.api-functions.api-clear-config;
|
||||
&programmers.api-functions.api-config-load;
|
||||
&programmers.api-functions.api-display;
|
||||
&programmers.api-functions.api-fetch;
|
||||
&programmers.api-functions.api-get-config-vars;
|
||||
&programmers.api-functions.api-get-registered-object;
|
||||
&programmers.api-functions.api-get-template-vars;
|
||||
&programmers.api-functions.api-is-cached;
|
||||
&programmers.api-functions.api-load-filter;
|
||||
&programmers.api-functions.api-register-block;
|
||||
&programmers.api-functions.api-register-compiler-function;
|
||||
&programmers.api-functions.api-register-function;
|
||||
&programmers.api-functions.api-register-modifier;
|
||||
&programmers.api-functions.api-register-object;
|
||||
&programmers.api-functions.api-register-outputfilter;
|
||||
&programmers.api-functions.api-register-postfilter;
|
||||
&programmers.api-functions.api-register-prefilter;
|
||||
&programmers.api-functions.api-register-resource;
|
||||
&programmers.api-functions.api-trigger-error;
|
||||
|
||||
&programmers.api-functions.api-template-exists;
|
||||
&programmers.api-functions.api-unregister-block;
|
||||
&programmers.api-functions.api-unregister-compiler-function;
|
||||
&programmers.api-functions.api-unregister-function;
|
||||
&programmers.api-functions.api-unregister-modifier;
|
||||
&programmers.api-functions.api-unregister-object;
|
||||
&programmers.api-functions.api-unregister-outputfilter;
|
||||
&programmers.api-functions.api-unregister-postfilter;
|
||||
&programmers.api-functions.api-unregister-prefilter;
|
||||
&programmers.api-functions.api-unregister-resource;
|
||||
|
||||
</reference>
|
||||
<!-- 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
|
||||
-->
|
59
docs/es/programmers/api-functions/api-append-by-ref.xml
Normal file
59
docs/es/programmers/api-functions/api-append-by-ref.xml
Normal file
@@ -0,0 +1,59 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.append.by.ref">
|
||||
<refnamediv>
|
||||
<refname>append_by_ref</refname>
|
||||
<refpurpose></refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>append_by_ref</methodname>
|
||||
<methodparam><type>string</type><parameter>varname</parameter></methodparam>
|
||||
<methodparam><type>mixed</type><parameter>var</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>bool</type><parameter>merge</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Este es usado para adicionar valores al templete por referencia.
|
||||
Si usted adiciona una variable por referencia entonces cambiara su valor,
|
||||
el valor asignado sufrira el cambio tambi<62>n. Para objetos, append_by_ref()
|
||||
tambi<62>n envia una copia en memoria del objeto adicionado. Vea el manual de
|
||||
PHP en referenciando variables para una mejor explicaci<63>n del asunto.
|
||||
Si usted pasa el tercer par<61>metro en true, el valor ser<65> mezclado con el
|
||||
arreglo en ves de ser adicionado.
|
||||
</para>
|
||||
¬e.parameter.merge;
|
||||
<example>
|
||||
<title>append_by_ref</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
// appending name/value pairs
|
||||
$smarty->append_by_ref("Name", $myname);
|
||||
$smarty->append_by_ref("Address", $address);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- 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
|
||||
-->
|
66
docs/es/programmers/api-functions/api-append.xml
Normal file
66
docs/es/programmers/api-functions/api-append.xml
Normal file
@@ -0,0 +1,66 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.append">
|
||||
<refnamediv>
|
||||
<refname>append</refname>
|
||||
<refpurpose></refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>append</methodname>
|
||||
<methodparam><type>mixed</type><parameter>var</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>append</methodname>
|
||||
<methodparam><type>string</type><parameter>varname</parameter></methodparam>
|
||||
<methodparam><type>mixed</type><parameter>var</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>bool</type><parameter>merge</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Este es usado para adicionar un elemento en un arreglo asignado.
|
||||
Si usted adiciona una cadena como valor, este se convertira en
|
||||
un valor del arreglo y entonces lo adiciona. Usted puede
|
||||
explicitamente pasar pares de nombres/valores, o arreglos asociativos
|
||||
conteniendo los pares nombre/valor. Si usted pasa el tercer par<61>metro
|
||||
opcional como true, el valor se <20>nira al arreglo actual en vez de ser
|
||||
adicionado.
|
||||
</para>
|
||||
¬e.parameter.merge;
|
||||
<example>
|
||||
<title>append</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
// passing name/value pairs
|
||||
$smarty->append("Name", "Fred");
|
||||
$smarty->append("Address", $address);
|
||||
|
||||
// passing an associative array
|
||||
$smarty->append(array("city" => "Lincoln", "state" => "Nebraska"));
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- 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
|
||||
-->
|
64
docs/es/programmers/api-functions/api-assign-by-ref.xml
Normal file
64
docs/es/programmers/api-functions/api-assign-by-ref.xml
Normal file
@@ -0,0 +1,64 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.assign.by.ref">
|
||||
<refnamediv>
|
||||
<refname>assign_by_ref</refname>
|
||||
<refpurpose></refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>assign_by_ref</methodname>
|
||||
<methodparam><type>string</type><parameter>varname</parameter></methodparam>
|
||||
<methodparam><type>mixed</type><parameter>var</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Este es usado para asignar valores por referencia al template en vez
|
||||
de hacer una copia. Vea el manual de PHP en la parte sobre referencia
|
||||
de variables para una explicaci<63>n mas detallada.
|
||||
</para>
|
||||
<note>
|
||||
<title>Nota T<>cnica</title>
|
||||
<para>
|
||||
Este es usado para asignar valores por referencia al template.
|
||||
Si ested asigna una variable por referencia entonces cambiara
|
||||
este valor, el valor asignado exprimentara el cambio tambi<62>n.
|
||||
Para objetos, assign_by_ref() tambi<62>n exite una copia del
|
||||
objetos asignado en memoria. Vea el manual de PHP en refereciando
|
||||
variables para una mejor explicaci<63>n.
|
||||
</para>
|
||||
</note>
|
||||
<example>
|
||||
<title>assign_by_ref</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
// passing name/value pairs
|
||||
$smarty->assign_by_ref('Name', $myname);
|
||||
$smarty->assign_by_ref('Address', $address);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- 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
|
||||
-->
|
60
docs/es/programmers/api-functions/api-assign.xml
Normal file
60
docs/es/programmers/api-functions/api-assign.xml
Normal file
@@ -0,0 +1,60 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.assign">
|
||||
<refnamediv>
|
||||
<refname>assign</refname>
|
||||
<refpurpose></refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>assign</methodname>
|
||||
<methodparam><type>mixed</type><parameter>var</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>assign</methodname>
|
||||
<methodparam><type>string</type><parameter>varname</parameter></methodparam>
|
||||
<methodparam><type>mixed</type><parameter>var</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Este es usado para asignar valores al template. Usted puede
|
||||
explicitamente pasar pares de nombres/valores, o un arreglo
|
||||
asociativo conteniendo el par de nombre/valor.
|
||||
</para>
|
||||
<example>
|
||||
<title>assign</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
// passing name/value pairs
|
||||
$smarty->assign('Name', 'Fred');
|
||||
$smarty->assign('Address', $address);
|
||||
|
||||
// passing an associative array
|
||||
$smarty->assign(array("city" => "Lincoln", "state" => "Nebraska"));
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- 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
|
||||
-->
|
49
docs/es/programmers/api-functions/api-clear-all-assign.xml
Normal file
49
docs/es/programmers/api-functions/api-clear-all-assign.xml
Normal file
@@ -0,0 +1,49 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.clear.all.assign">
|
||||
<refnamediv>
|
||||
<refname>clear_all_assign</refname>
|
||||
<refpurpose></refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>clear_all_assign</methodname>
|
||||
<void />
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Esto limpia el valor de todas las variables asignadas.
|
||||
</para>
|
||||
<example>
|
||||
<title>clear_all_assign</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
// clear all assigned variables
|
||||
$smarty->clear_all_assign();
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- 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
|
||||
-->
|
51
docs/es/programmers/api-functions/api-clear-all-cache.xml
Normal file
51
docs/es/programmers/api-functions/api-clear-all-cache.xml
Normal file
@@ -0,0 +1,51 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.clear.all.cache">
|
||||
<refnamediv>
|
||||
<refname>clear_all_cache</refname>
|
||||
<refpurpose></refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>clear_all_cache</methodname>
|
||||
<methodparam choice="opt"><type>int</type><parameter>expire_time</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Esto limpia completamente el cache del template. Como un par<61>metro
|
||||
opcional, usted puede proporcionar un periodo minimo en segundos
|
||||
que el archivo de cache debe tener antes de ser anulado.
|
||||
</para>
|
||||
<example>
|
||||
<title>clear_all_cache</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
// clear the entire cache
|
||||
$smarty->clear_all_cache();
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- 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
|
||||
-->
|
53
docs/es/programmers/api-functions/api-clear-assign.xml
Normal file
53
docs/es/programmers/api-functions/api-clear-assign.xml
Normal file
@@ -0,0 +1,53 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.clear.assign">
|
||||
<refnamediv>
|
||||
<refname>clear_assign</refname>
|
||||
<refpurpose></refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>clear_assign</methodname>
|
||||
<methodparam><type>mixed</type><parameter>var</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Esto limpia el valor de una viariable asignada. Este puede ser un
|
||||
valor simple, o un arreglo de valores.
|
||||
</para>
|
||||
<example>
|
||||
<title>clear_assign</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
// clear a single variable
|
||||
$smarty->clear_assign("Name");
|
||||
|
||||
// clear multiple variables
|
||||
$smarty->clear_assign(array("Name", "Address", "Zip"));
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- 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
|
||||
-->
|
64
docs/es/programmers/api-functions/api-clear-cache.xml
Normal file
64
docs/es/programmers/api-functions/api-clear-cache.xml
Normal file
@@ -0,0 +1,64 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.clear.cache">
|
||||
<refnamediv>
|
||||
<refname>clear_cache</refname>
|
||||
<refpurpose></refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>clear_cache</methodname>
|
||||
<methodparam><type>string</type><parameter>template</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>string</type><parameter>cache_id</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>string</type><parameter>compile_id</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>expire_time</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Esto limpia el cahce de un <parameter>template</parameter> especifico.
|
||||
Si usted tiene multiples caches en este archivo, usted puede limpiar un
|
||||
cache especifico proporcionando el <parameter>cache_id</parameter> como
|
||||
segundo par<61>metro Usted tambi<62>n puede pasar el
|
||||
<parameter>compile_id</parameter> como un tercer par<61>metro.
|
||||
Usted puede "agrupar" templates conjuntamente de esta manera estos pueden
|
||||
ser removidos como un grupo. Vea el
|
||||
<link linkend="caching">caching section</link> para mayor informaci<63>n.
|
||||
Como un cuarto par<61>metro opcional, usted puede proporcionar un periodo
|
||||
minimo en segundos que el archivo de cache debe tener antes de ser anulado.
|
||||
</para>
|
||||
<example>
|
||||
<title>clear_cache</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
// clear the cache for a template
|
||||
$smarty->clear_cache("index.tpl");
|
||||
|
||||
// clear the cache for a particular cache id in an multiple-cache template
|
||||
$smarty->clear_cache("index.tpl", "CACHEID");
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- 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
|
||||
-->
|
60
docs/es/programmers/api-functions/api-clear-compiled-tpl.xml
Normal file
60
docs/es/programmers/api-functions/api-clear-compiled-tpl.xml
Normal file
@@ -0,0 +1,60 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.clear.compiled.tpl">
|
||||
<refnamediv>
|
||||
<refname>clear_compiled_tpl</refname>
|
||||
<refpurpose></refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>clear_compiled_tpl</methodname>
|
||||
<methodparam choice="opt"><type>string</type><parameter>tpl_file</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>string</type><parameter>compile_id</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>exp_time</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Esto limpia la versi<73>n compilada del recurso del template especificado,
|
||||
o todos los archivos de templates compilados si no fueron especificados.
|
||||
si usted lo pasa compile_is es limpiado. si usted lo pasa con ex_time,
|
||||
entonces solo compilara los templates anteriores al exp_time segundo
|
||||
seran limpiados, por default todos los templates son compilados y
|
||||
limpiados independientemente de su tiempo de vida.
|
||||
Esta funci<63>n es solo para uso avanzado, normalmente no es necesaria.
|
||||
</para>
|
||||
<example>
|
||||
<title>clear_compiled_tpl</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
// clear a specific template resource
|
||||
$smarty->clear_compiled_tpl("index.tpl");
|
||||
|
||||
// clear entire compile directory
|
||||
$smarty->clear_compiled_tpl();
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- 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
|
||||
-->
|
54
docs/es/programmers/api-functions/api-clear-config.xml
Normal file
54
docs/es/programmers/api-functions/api-clear-config.xml
Normal file
@@ -0,0 +1,54 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.clear.config">
|
||||
<refnamediv>
|
||||
<refname>clear_config</refname>
|
||||
<refpurpose></refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>clear_config</methodname>
|
||||
<methodparam choice="opt"><type>string</type><parameter>var</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Esto limpia todas las variables de configuraci<63>n asignadas.
|
||||
Si es proporcionado el nombre de una variable, solamente esta
|
||||
variable es limpiada.
|
||||
</para>
|
||||
<example>
|
||||
<title>clear_config</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
// clear all assigned config variables.
|
||||
$smarty->clear_config();
|
||||
|
||||
// clear one variable
|
||||
$smarty->clear_config('foobar');
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- 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
|
||||
-->
|
68
docs/es/programmers/api-functions/api-config-load.xml
Normal file
68
docs/es/programmers/api-functions/api-config-load.xml
Normal file
@@ -0,0 +1,68 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.config.load">
|
||||
<refnamediv>
|
||||
<refname>config_load</refname>
|
||||
<refpurpose></refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>config_load</methodname>
|
||||
<methodparam><type>string</type><parameter>file</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>string</type><parameter>section</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Esto carga el <parameter>archivo</parameter> de configuraci<63>n de
|
||||
datos y lo asigna al template. Esto funciona id<69>ntico a la funci<63>n
|
||||
<link linkend="language.function.config.load">config_load</link>.
|
||||
</para>
|
||||
<note>
|
||||
<title>Nota T<>cnica</title>
|
||||
<para>
|
||||
A partir de Smarty 2.4.0, las variables de template asignadas son
|
||||
mantenidas a trav<61>s de fetch() y display(). Las variables de
|
||||
configuraci<63>n cargadas de config_load() son siempre de alcance global.
|
||||
Los archivos de configuracion tambi<62>n son compilados para
|
||||
execución rapida, y respetar el
|
||||
<link linkend="variable.force.compile">force_compile</link> y
|
||||
<link linkend="variable.compile.check">compile_check</link> de
|
||||
configuraci<63>n.
|
||||
</para>
|
||||
</note>
|
||||
<example>
|
||||
<title>config_load</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
// load config variables and assign them
|
||||
$smarty->config_load('my.conf');
|
||||
|
||||
// load a section
|
||||
$smarty->config_load('my.conf', 'foobar');
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- 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
|
||||
-->
|
102
docs/es/programmers/api-functions/api-display.xml
Normal file
102
docs/es/programmers/api-functions/api-display.xml
Normal file
@@ -0,0 +1,102 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.display">
|
||||
<refnamediv>
|
||||
<refname>display</refname>
|
||||
<refpurpose></refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>display</methodname>
|
||||
<methodparam><type>string</type><parameter>template</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>string</type><parameter>cache_id</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>string</type><parameter>compile_id</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Este despliega el template. cargando un tipo valido de path
|
||||
<link linkend="template.resources">template resource</link>.
|
||||
Como un segundo par<61>metro opcional, usted puede pasar un
|
||||
identificador de cache.
|
||||
Vea el <link linkend="caching">caching section</link> para mayor
|
||||
informaci<63>n.
|
||||
</para>
|
||||
¶meter.compileid;
|
||||
<example>
|
||||
<title>display</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
include("Smarty.class.php");
|
||||
$smarty = new Smarty;
|
||||
$smarty->caching = true;
|
||||
|
||||
// only do db calls if cache doesn't exist
|
||||
if(!$smarty->is_cached("index.tpl")) {
|
||||
|
||||
// dummy up some data
|
||||
$address = "245 N 50th";
|
||||
$db_data = array(
|
||||
"City" => "Lincoln",
|
||||
"State" => "Nebraska",
|
||||
"Zip" => "68502"
|
||||
);
|
||||
|
||||
$smarty->assign("Name","Fred");
|
||||
$smarty->assign("Address",$address);
|
||||
$smarty->assign($db_data);
|
||||
|
||||
}
|
||||
|
||||
// display the output
|
||||
$smarty->display("index.tpl");
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Use la sintaxis <link linkend="template.resources">template resources</link>
|
||||
para mostrar archivos fuera del directorio $template_dir.
|
||||
</para>
|
||||
<example>
|
||||
<title>Ejemplos de recursos de la funci<63>n display</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
// absolute filepath
|
||||
$smarty->display("/usr/local/include/templates/header.tpl");
|
||||
|
||||
// absolute filepath (same thing)
|
||||
$smarty->display("file:/usr/local/include/templates/header.tpl");
|
||||
|
||||
// windows absolute filepath (MUST use "file:" prefix)
|
||||
$smarty->display("file:C:/www/pub/templates/header.tpl");
|
||||
|
||||
// include from template resource named "db"
|
||||
$smarty->display("db:header.tpl");
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- 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
|
||||
-->
|
86
docs/es/programmers/api-functions/api-fetch.xml
Normal file
86
docs/es/programmers/api-functions/api-fetch.xml
Normal file
@@ -0,0 +1,86 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.fetch">
|
||||
<refnamediv>
|
||||
<refname>fetch</refname>
|
||||
<refpurpose></refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<methodsynopsis>
|
||||
<type>string</type><methodname>fetch</methodname>
|
||||
<methodparam><type>string</type><parameter>template</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>string</type><parameter>cache_id</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>string</type><parameter>compile_id</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Este retorna la salida del template en vez de desplegarla.
|
||||
Proporcionando un tipo y path valido
|
||||
<link linkend="template.resources">template resource</link>.
|
||||
Como un segundo par<61>metro opcional, usted puede pasar el
|
||||
identificador de cache.
|
||||
vea el <link linkend="caching">caching section</link> para
|
||||
mayor informaci<63>n.
|
||||
</para>
|
||||
¶meter.compileid;
|
||||
<para>
|
||||
<example>
|
||||
<title>fetch</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
include("Smarty.class.php");
|
||||
$smarty = new Smarty;
|
||||
|
||||
$smarty->caching = true;
|
||||
|
||||
// only do db calls if cache doesn't exist
|
||||
if(!$smarty->is_cached("index.tpl")) {
|
||||
|
||||
// dummy up some data
|
||||
$address = "245 N 50th";
|
||||
$db_data = array(
|
||||
"City" => "Lincoln",
|
||||
"State" => "Nebraska",
|
||||
"Zip" => "68502"
|
||||
);
|
||||
|
||||
$smarty->assign("Name","Fred");
|
||||
$smarty->assign("Address",$address);
|
||||
$smarty->assign($db_data);
|
||||
|
||||
}
|
||||
|
||||
// capture the output
|
||||
$output = $smarty->fetch("index.tpl");
|
||||
|
||||
// do something with $output here
|
||||
|
||||
echo $output;
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- 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
|
||||
-->
|
57
docs/es/programmers/api-functions/api-get-config-vars.xml
Normal file
57
docs/es/programmers/api-functions/api-get-config-vars.xml
Normal file
@@ -0,0 +1,57 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.get.config.vars">
|
||||
<refnamediv>
|
||||
<refname>get_config_vars</refname>
|
||||
<refpurpose></refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<methodsynopsis>
|
||||
<type>array</type><methodname>get_config_vars</methodname>
|
||||
<methodparam choice="opt"><type>string</type><parameter>varname</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Este retona el valor de la variable de configuraci<63>n dado.
|
||||
Si no tiene un par<61>metro dado, un arreglo de todas las variables
|
||||
de los archivos de configuraci<63>n es retornado.
|
||||
</para>
|
||||
<example>
|
||||
<title>get_config_vars</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
// get loaded config template var 'foo'
|
||||
$foo = $smarty->get_config_vars('foo');
|
||||
|
||||
// get all loaded config template vars
|
||||
$config_vars = $smarty->get_config_vars();
|
||||
|
||||
// take a look at them
|
||||
print_r($config_vars);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- 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
|
||||
-->
|
@@ -0,0 +1,57 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.get.registered.object">
|
||||
<refnamediv>
|
||||
<refname>get_registered_object</refname>
|
||||
<refpurpose></refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<methodsynopsis>
|
||||
<type>array</type><methodname>get_registered_object</methodname>
|
||||
<methodparam><type>string</type><parameter>object_name</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Este retorna una referencia para un objeto registrado.
|
||||
Este es <20>til dentro de una funci<63>n habitual cuando usted
|
||||
necesita acesar directamente a un objeto registrado.
|
||||
</para>
|
||||
<example>
|
||||
<title>get_registered_object</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
function smarty_block_foo($params, &$smarty)
|
||||
{
|
||||
if (isset($params['object'])) {
|
||||
// get reference to registered object
|
||||
$obj_ref = &$smarty->get_registered_object($params['object']);
|
||||
// use $obj_ref is now a reference to the object
|
||||
}
|
||||
}
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- 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
|
||||
-->
|
57
docs/es/programmers/api-functions/api-get-template-vars.xml
Normal file
57
docs/es/programmers/api-functions/api-get-template-vars.xml
Normal file
@@ -0,0 +1,57 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.get.template.vars">
|
||||
<refnamediv>
|
||||
<refname>get_template_vars</refname>
|
||||
<refpurpose></refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<methodsynopsis>
|
||||
<type>array</type><methodname>get_template_vars</methodname>
|
||||
<methodparam choice="opt"><type>string</type><parameter>varname</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Este retorna el valor de una variable asignada. Si no tiene un
|
||||
par<61>metro dado, un arreglo de todas las variables asignadas es
|
||||
retornado.
|
||||
</para>
|
||||
<example>
|
||||
<title>get_template_vars</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
// get assigned template var 'foo'
|
||||
$foo = $smarty->get_template_vars('foo');
|
||||
|
||||
// get all assigned template vars
|
||||
$tpl_vars = $smarty->get_template_vars();
|
||||
|
||||
// take a look at them
|
||||
print_r($tpl_vars);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- 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
|
||||
-->
|
107
docs/es/programmers/api-functions/api-is-cached.xml
Normal file
107
docs/es/programmers/api-functions/api-is-cached.xml
Normal file
@@ -0,0 +1,107 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.is.cached">
|
||||
<refnamediv>
|
||||
<refname>is_cached</refname>
|
||||
<refpurpose></refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>is_cached</methodname>
|
||||
<methodparam><type>string</type><parameter>template</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>string</type><parameter>cache_id</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>string</type><parameter>compile_id</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Este retorna true si hay un cache valido para ese template.
|
||||
Esto solamente funciona si <link linkend="variable.caching">
|
||||
caching</link> est<73> asignado a true.
|
||||
</para>
|
||||
<example>
|
||||
<title>is_cached</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$smarty->caching = true;
|
||||
|
||||
if(!$smarty->is_cached("index.tpl")) {
|
||||
// do database calls, assign vars here
|
||||
}
|
||||
|
||||
$smarty->display("index.tpl");
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Usted tambi<62>n puede pasar un identificador de cache como un
|
||||
segundo par<61>metro opcional en el caso que usted quiera multiples
|
||||
caches para el template dado.
|
||||
</para>
|
||||
<para>
|
||||
Usted puede proporcionar el identidicador como un tercer parametro
|
||||
opcional. Si usted omite ese parametro la persistencia del
|
||||
<link linkend="variable.compile.id">$compile_id</link> es usada.
|
||||
</para>
|
||||
<para>
|
||||
Si usted no quiere pasar el identificador de cache solamente
|
||||
quiere pasar el compile id debe pasar <literal>null</literal>
|
||||
como el identidficador de cache.
|
||||
</para>
|
||||
<example>
|
||||
<title>is_cached con templates con multiple-cache</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$smarty->caching = true;
|
||||
|
||||
if(!$smarty->is_cached("index.tpl", "FrontPage")) {
|
||||
// do database calls, assign vars here
|
||||
}
|
||||
|
||||
$smarty->display("index.tpl", "FrontPage");
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
|
||||
<note>
|
||||
<title>Nota t<>cnica</title>
|
||||
<para>
|
||||
Si <literal>is_cached</literal> retorna true el carga actualmente
|
||||
la salida del cache y lo guarda internamente. cualquier subsecuente
|
||||
llama a <link linkend="api.display">display()</link> o
|
||||
<link linkend="api.fetch">fetch()</link> y retorna este internamente
|
||||
guardando la salida y no intenta volver a cargar el archivo del cache.
|
||||
Esto previene una condicion de la carrera que puede ocurrir cuando un
|
||||
segundo proceso limpie el cache entre las llamadas a is_cached mostradas
|
||||
en el ejemplo de arriba. Esto significa tambien llamar al
|
||||
<link linkend="api.clear.cache">clear_cache()</link> y otros cambios
|
||||
en el cache-settings que no tiene efecto despues que
|
||||
<literal>is_cached</literal> retorna true.
|
||||
</para>
|
||||
</note>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- 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
|
||||
-->
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user