mirror of
https://github.com/smarty-php/smarty.git
synced 2025-11-03 13:51:36 +01:00
huge sync with english by the translator (Mario Ramirez)
thanks
This commit is contained in:
@@ -3,10 +3,10 @@
|
||||
<refentry id="api.append.by.ref">
|
||||
<refnamediv>
|
||||
<refname>append_by_ref</refname>
|
||||
<refpurpose></refpurpose>
|
||||
<refpurpose>pasando valores por referencia</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<title>Descipci<EFBFBD>n</title>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>append_by_ref</methodname>
|
||||
<methodparam><type>string</type><parameter>varname</parameter></methodparam>
|
||||
@@ -14,9 +14,10 @@
|
||||
<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()
|
||||
Este es usado para <link linkend="api.append">pasar</link> valores al
|
||||
templete por referencia. Si usted pasa una variable por referencia entonces
|
||||
cambiara su valor, el valor asignado sufrira el cambio tambi<62>n. Para
|
||||
<link linkend="advanced.features.objects">objetos</link>, 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
|
||||
@@ -35,6 +36,11 @@ $smarty->append_by_ref("Address", $address);
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Ver tambi<62>n <link linkend="api.append">append()</link>
|
||||
y <link linkend="api.assign">assign()</link>.
|
||||
</para>
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.append">
|
||||
<refnamediv>
|
||||
<refname>append</refname>
|
||||
<refpurpose></refpurpose>
|
||||
<refname>append()</refname>
|
||||
<refpurpose>agregando elementos a una matriz asignada</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<title>Descripci<EFBFBD>n</title>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>append</methodname>
|
||||
<methodparam><type>mixed</type><parameter>var</parameter></methodparam>
|
||||
@@ -37,11 +37,17 @@ $smarty->append("Name", "Fred");
|
||||
$smarty->append("Address", $address);
|
||||
|
||||
// passing an associative array
|
||||
$smarty->append(array("city" => "Lincoln", "state" => "Nebraska"));
|
||||
$smarty->append(array('city' => 'Lincoln', 'state' => 'Nebraska'));
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>Ver tambi<62>n
|
||||
<link linkend="api.append.by.ref">append_by_ref()</link>,
|
||||
<link linkend="api.assign">assign()</link>
|
||||
y
|
||||
<link linkend="api.get.template.vars">get_template_vars()</link>
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
||||
@@ -3,19 +3,19 @@
|
||||
<refentry id="api.assign.by.ref">
|
||||
<refnamediv>
|
||||
<refname>assign_by_ref</refname>
|
||||
<refpurpose></refpurpose>
|
||||
<refpurpose>pasando valores por referencia</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<title>Descripci<EFBFBD>n</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.
|
||||
Este es usado para <link linkend="api.assign">asignar</link> 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>
|
||||
@@ -23,13 +23,13 @@
|
||||
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 <link linkend="advanced.features.objects">objetos</link>,
|
||||
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>
|
||||
<title>assign_by_ref()</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
@@ -40,6 +40,13 @@ $smarty->assign_by_ref('Address', $address);
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Ver tambi<62>n <link linkend="api.assign">assign()</link>,
|
||||
<link linkend="api.clear.all.assign">clear_all_assign()</link>,
|
||||
<link linkend="api.append">append()</link>
|
||||
y <link linkend="language.function.assign">{assign}</link>
|
||||
</para>
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.assign">
|
||||
<refnamediv>
|
||||
<refname>assign</refname>
|
||||
<refpurpose></refpurpose>
|
||||
<refname>assign()</refname>
|
||||
<refpurpose>pasando valores para el template</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<title>Descripci<EFBFBD>n</title>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>assign</methodname>
|
||||
<methodparam><type>mixed</type><parameter>var</parameter></methodparam>
|
||||
@@ -17,25 +17,57 @@
|
||||
<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
|
||||
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">
|
||||
<title>assign()</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
// passing name/value pairs
|
||||
// pasando pares de nombre/valor
|
||||
$smarty->assign('Name', 'Fred');
|
||||
$smarty->assign('Address', $address);
|
||||
|
||||
// passing an associative array
|
||||
$smarty->assign(array("city" => "Lincoln", "state" => "Nebraska"));
|
||||
// pasando un arreglo asosiativo
|
||||
$smarty->assign(array('city' => 'Lincoln', 'state' => 'Nebraska'));
|
||||
|
||||
// pasando un row desde una base de datos (eg adodb)
|
||||
$sql = 'select id, name, email from contacts where contact ='.$id;
|
||||
$smarty->assign('contact', $db->getRow($sql));
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</programlisting>
|
||||
<para>
|
||||
Accesando estos en el template con
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{$Name}
|
||||
{$Address}
|
||||
{$city}
|
||||
{$state}
|
||||
|
||||
{$contact.id}, {$contact.name},{$contact.email}
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Para ver una asignacion de arreglos mas compleja
|
||||
<link linkend="language.function.foreach">{foreach}</link>
|
||||
y
|
||||
<link linkend="language.function.section">{section}</link>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Vea tambi<62>n <link linkend="api.assign.by.ref">assign_by_ref()</link>,
|
||||
<link linkend="api.get.template.vars">get_template_vars()</link>,
|
||||
<link linkend="api.clear.assign">clear_assign()</link>,
|
||||
<link linkend="api.append">append()</link>
|
||||
y
|
||||
<link linkend="language.function.assign">{assign}</link>
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
||||
@@ -2,29 +2,43 @@
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.clear.all.assign">
|
||||
<refnamediv>
|
||||
<refname>clear_all_assign</refname>
|
||||
<refpurpose></refpurpose>
|
||||
<refname>clear_all_assign()</refname>
|
||||
<refpurpose>>limpia el valor de todas las variables asignadas</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<title>Descripci<EFBFBD>n</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>
|
||||
<title>clear_all_assign()</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
// passing name/value pairs
|
||||
$smarty->assign('Name', 'Fred');
|
||||
$smarty->assign('Address', $address);
|
||||
|
||||
// will output above
|
||||
print_r( $smarty->get_template_vars() );
|
||||
|
||||
// clear all assigned variables
|
||||
$smarty->clear_all_assign();
|
||||
|
||||
// will output nothing
|
||||
print_r( $smarty->get_template_vars() );
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Ver tambi<62>n
|
||||
<link linkend="api.clear.assign">clear_assign()</link>,
|
||||
<link linkend="api.clear.config">clear_config()</link>,
|
||||
<link linkend="api.assign">assign()</link>
|
||||
y <link linkend="api.append">append()</link>
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<refentry id="api.clear.all.cache">
|
||||
<refnamediv>
|
||||
<refname>clear_all_cache</refname>
|
||||
<refpurpose></refpurpose>
|
||||
<refpurpose>limpia completamente el cache del template</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
@@ -12,9 +12,8 @@
|
||||
<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.
|
||||
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>
|
||||
@@ -27,6 +26,13 @@ $smarty->clear_all_cache();
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Ver tambi<62>n
|
||||
<link linkend="api.clear.cache">clear_cache()</link>,
|
||||
<link linkend="api.is.cached">is_cached()</link>
|
||||
y
|
||||
<link linkend="caching">caching</link>
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
||||
@@ -2,33 +2,40 @@
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.clear.assign">
|
||||
<refnamediv>
|
||||
<refname>clear_assign</refname>
|
||||
<refpurpose></refpurpose>
|
||||
<refname>clear_assign()</refname>
|
||||
<refpurpose>limpia el valor de una variable asignada</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<title> Descripci<63>n</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.
|
||||
Este puede ser un valor simple, o un arreglo de valores.
|
||||
</para>
|
||||
<example>
|
||||
<title>clear_assign</title>
|
||||
<title>clear_assign()</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
// clear a single variable
|
||||
$smarty->clear_assign("Name");
|
||||
$smarty->clear_assign('Name');
|
||||
|
||||
// clear multiple variables
|
||||
$smarty->clear_assign(array("Name", "Address", "Zip"));
|
||||
$smarty->clear_assign(array('Name', 'Address', 'Zip'));
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Ver tambi<62>n
|
||||
<link linkend="api.clear.all.assign">clear_all_assign()</link>,
|
||||
<link linkend="api.clear.config">clear_config()</link>,
|
||||
<link linkend="api.get.template.vars">get_template_vars()</link>,
|
||||
<link linkend="api.assign">assign()</link>
|
||||
y <link linkend="api.append">append()</link>
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.clear.cache">
|
||||
<refnamediv>
|
||||
<refname>clear_cache</refname>
|
||||
<refpurpose></refpurpose>
|
||||
<refname>clear_cache()</refname>
|
||||
<refpurpose>Esto limpia el cache de un template especifico</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<title>Descripci<EFBFBD>n</title>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>clear_cache</methodname>
|
||||
<methodparam><type>string</type><parameter>template</parameter></methodparam>
|
||||
@@ -15,31 +15,36 @@
|
||||
<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<EFBFBD>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.
|
||||
Si usted tiene <link linkend="caching.multiple.caches">multiples</link> 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 <link linkend="variable.compile.id"><parameter>$compile_id</parameter></link>
|
||||
como un tercer par<EFBFBD>metro. Usted puede <link linkend="caching.groups">"agrupar"</link>
|
||||
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>
|
||||
<title>clear_cache()</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
// clear the cache for a template
|
||||
$smarty->clear_cache("index.tpl");
|
||||
$smarty->clear_cache('index.tpl');
|
||||
|
||||
// clear the cache for a particular cache id in an multiple-cache template
|
||||
$smarty->clear_cache("index.tpl", "CACHEID");
|
||||
$smarty->clear_cache('index.tpl', 'CACHEID');
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Ver tambi<62>n
|
||||
<link linkend="api.clear.all.cache">clear_all_cache()</link>
|
||||
y
|
||||
<link linkend="caching">caching</link>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.clear.compiled.tpl">
|
||||
<refnamediv>
|
||||
<refname>clear_compiled_tpl</refname>
|
||||
<refpurpose></refpurpose>
|
||||
<refname>clear_compiled_tpl()</refname>
|
||||
<refpurpose>Esto limpia la vesion compilada del recurso de un template especifico</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<title>Descripci<EFBFBD>n</title>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>clear_compiled_tpl</methodname>
|
||||
<methodparam choice="opt"><type>string</type><parameter>tpl_file</parameter></methodparam>
|
||||
@@ -16,14 +16,16 @@
|
||||
<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.
|
||||
si usted pasa <link linkend="variable.compile.id">$compile_id</link> solo
|
||||
sera compilado este template especificado
|
||||
<link linkend="variable.compile.id">$compile_id</link> 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>
|
||||
<title>clear_compiled_tpl()</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
@@ -2,22 +2,22 @@
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.clear.config">
|
||||
<refnamediv>
|
||||
<refname>clear_config</refname>
|
||||
<refpurpose></refpurpose>
|
||||
<refname>clear_config()</refname>
|
||||
<refpurpose>Esto limpia todas las variables de configuraci<63>n</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<title>Descripci<EFBFBD>n</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<EFBFBD>n asignadas.
|
||||
Si es proporcionado el nombre de una variable, solamente esta
|
||||
variable es limpiada.
|
||||
Esto limpia todas las variables de
|
||||
<link linkend="language.config.variables">configuraci<EFBFBD>n asignadas</link>.
|
||||
Si es proporcionado el nombre de una variable, solo esa variable es limpiada.
|
||||
</para>
|
||||
<example>
|
||||
<title>clear_config</title>
|
||||
<title>clear_config()</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
@@ -30,6 +30,16 @@ $smarty->clear_config('foobar');
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Ver tambi<62>n
|
||||
<link linkend="api.get.config.vars">get_config_vars()</link>,
|
||||
<link linkend="language.config.variables">config variables</link>,
|
||||
<link linkend="config.files">config files</link>,
|
||||
<link linkend="language.function.config.load">{config_load}</link>,
|
||||
<link linkend="api.config.load">config_load()</link>
|
||||
y
|
||||
<link linkend="api.clear.assign">clear_assign()</link>
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
||||
@@ -2,26 +2,27 @@
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.config.load">
|
||||
<refnamediv>
|
||||
<refname>config_load</refname>
|
||||
<refpurpose></refpurpose>
|
||||
<refname>config_load()</refname>
|
||||
<refpurpose>Carga el archivo de configuraci<63>n y lo asigna al template</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<title>Descripci<EFBFBD>n</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
|
||||
Esto carga el <link linkend="config.files">archivo de configuraci<63>n</link> 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>.
|
||||
<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
|
||||
mantenidas a trav<61>s de <link linkend="api.fetch">fetch()</link> y
|
||||
<link linkend="api.display">display()</link>. 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
|
||||
@@ -31,7 +32,7 @@
|
||||
</para>
|
||||
</note>
|
||||
<example>
|
||||
<title>config_load</title>
|
||||
<title>config_load()</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
@@ -44,6 +45,14 @@ $smarty->config_load('my.conf', 'foobar');
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Ver tambi<62>n
|
||||
<link linkend="language.function.config.load">{config_load}</link>,
|
||||
<link linkend="api.get.config.vars">get_config_vars()</link>,
|
||||
<link linkend="api.clear.config">clear_config()</link>,
|
||||
y
|
||||
<link linkend="language.config.variables">config variables</link>
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.display">
|
||||
<refnamediv>
|
||||
<refname>display</refname>
|
||||
<refpurpose></refpurpose>
|
||||
<refname>display()</refname>
|
||||
<refpurpose>Despliega el Template</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<title>Descripci<EFBFBD>n </title>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>display</methodname>
|
||||
<methodparam><type>string</type><parameter>template</parameter></methodparam>
|
||||
@@ -14,7 +14,8 @@
|
||||
<methodparam choice="opt"><type>string</type><parameter>compile_id</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Este despliega el template. cargando un tipo valido de path
|
||||
Este despliega el template diferente de <link
|
||||
linkend="api.fetch">fetch()</link>. 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.
|
||||
@@ -23,7 +24,7 @@
|
||||
</para>
|
||||
¶meter.compileid;
|
||||
<example>
|
||||
<title>display</title>
|
||||
<title>display()</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
@@ -56,7 +57,8 @@ $smarty->display("index.tpl");
|
||||
</example>
|
||||
<para>
|
||||
Use la sintaxis <link linkend="template.resources">template resources</link>
|
||||
para mostrar archivos fuera del directorio $template_dir.
|
||||
para mostrar archivos fuera del directorio
|
||||
<link linkend="variable.template.dir">$template_dir</link>.
|
||||
</para>
|
||||
<example>
|
||||
<title>Ejemplos de recursos de la funci<63>n display</title>
|
||||
@@ -64,20 +66,24 @@ $smarty->display("index.tpl");
|
||||
<![CDATA[
|
||||
<?php
|
||||
// absolute filepath
|
||||
$smarty->display("/usr/local/include/templates/header.tpl");
|
||||
$smarty->display('/usr/local/include/templates/header.tpl');
|
||||
|
||||
// absolute filepath (same thing)
|
||||
$smarty->display("file:/usr/local/include/templates/header.tpl");
|
||||
$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");
|
||||
$smarty->display('file:C:/www/pub/templates/header.tpl');
|
||||
|
||||
// include from template resource named "db"
|
||||
$smarty->display("db:header.tpl");
|
||||
$smarty->display('db:header.tpl');
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Ver tambi<62>n <link linkend="api.fetch">fetch()</link> y
|
||||
<link linkend="api.template.exists">template_exists()</link>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
||||
@@ -2,19 +2,20 @@
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.fetch">
|
||||
<refnamediv>
|
||||
<refname>fetch</refname>
|
||||
<refpurpose></refpurpose>
|
||||
<refname>fetch()</refname>
|
||||
<refpurpose>Retorna la salida del template</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<title>Descripci<EFBFBD>n</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>
|
||||
<methodparam choice="opt"><type>string</type><parameter>$compile_id</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Este retorna la salida del template en vez de desplegarla.
|
||||
Este retorna la salida del template en vez de
|
||||
<link linkend="api.display">desplegarla</link>.
|
||||
Proporcionando un tipo y path valido
|
||||
<link linkend="template.resources">template resource</link>.
|
||||
Como un segundo par<61>metro opcional, usted puede pasar el
|
||||
@@ -23,36 +24,37 @@
|
||||
mayor informaci<63>n.
|
||||
</para>
|
||||
¶meter.compileid;
|
||||
|
||||
<para>
|
||||
<example>
|
||||
<title>fetch</title>
|
||||
<title>fetch()</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
include("Smarty.class.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")) {
|
||||
if(!$smarty->is_cached('index.tpl')) {
|
||||
|
||||
// dummy up some data
|
||||
$address = "245 N 50th";
|
||||
$address = '245 N 50th';
|
||||
$db_data = array(
|
||||
"City" => "Lincoln",
|
||||
"State" => "Nebraska",
|
||||
"Zip" => "68502"
|
||||
'City' => 'Lincoln',
|
||||
'State' => 'Nebraska',
|
||||
'Zip' => '68502'
|
||||
);
|
||||
|
||||
$smarty->assign("Name","Fred");
|
||||
$smarty->assign("Address",$address);
|
||||
$smarty->assign('Name','Fred');
|
||||
$smarty->assign('Address',$address);
|
||||
$smarty->assign($db_data);
|
||||
|
||||
}
|
||||
|
||||
// capture the output
|
||||
$output = $smarty->fetch("index.tpl");
|
||||
$output = $smarty->fetch('index.tpl');
|
||||
|
||||
// do something with $output here
|
||||
|
||||
@@ -62,8 +64,75 @@ echo $output;
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
<para>
|
||||
<example>
|
||||
<title>Usando fetch() y enviando a un e-mail</title>
|
||||
<para>
|
||||
El template email_body.tpl
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
Dear {$contact.name},
|
||||
|
||||
Welcome and thankyou for signing up as a member of our user group,
|
||||
|
||||
Click on the link below to login with your user name of '{$contact.login_id}'
|
||||
so you can post in our forums.
|
||||
|
||||
http://{$smarty.server.SERVER_NAME}/index.php?page=login
|
||||
|
||||
List master
|
||||
Some user group
|
||||
|
||||
{include file="email_disclaimer.tpl"}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
El template email_disclaimer.tpl usando el modificador
|
||||
<link linkend="language.function.textformat">{textformat}</link>.
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{textformat wrap=40}
|
||||
Unless you are named "{$contact.name}", you may read only the "odd numbered
|
||||
words" (every other word beginning with the first) of the message above. If you have
|
||||
violated that, then you hereby owe the sender 10 GBP for each even
|
||||
numbered word you have read
|
||||
{/textformat}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
y el script de PHP usando la funci<63>n
|
||||
<ulink url="&url.php-manual;function.mail">mail()</ulink>
|
||||
</para>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
// get contact from database eg using pear or adodb
|
||||
$query = 'select name, email, login_id from contacts where contact_id='.$contact_id;
|
||||
$contact = $db->getRow($sql);
|
||||
$smarty->assign('contact', $contact);
|
||||
|
||||
mail($contact['email'], 'Subject', $smarty->fetch('email_body.tpl'));
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Ver tambi<62>n
|
||||
<link linkend="language.function.fetch">{fetch}</link>
|
||||
<link linkend="api.display">display()</link>,
|
||||
<link linkend="language.function.eval">{eval}</link>,
|
||||
y
|
||||
<link linkend="api.template.exists">template_exists()</link>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
|
||||
@@ -2,22 +2,22 @@
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.get.config.vars">
|
||||
<refnamediv>
|
||||
<refname>get_config_vars</refname>
|
||||
<refpurpose></refpurpose>
|
||||
<refname>get_config_vars()</refname>
|
||||
<refpurpose>retorna el valor asignado a la variable de configuraci<63>n</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<title>Descripci<EFBFBD>n</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.
|
||||
Si no tiene un par<61>metro asignado, un arreglo de todas las
|
||||
<link linkend="language.config.variables">variables
|
||||
de los archivos de configuraci<63>n</link> es retornado.
|
||||
</para>
|
||||
<example>
|
||||
<title>get_config_vars</title>
|
||||
<title>get_config_vars()</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
@@ -33,6 +33,14 @@ print_r($config_vars);
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Ver tambi<62>n
|
||||
<link linkend="api.clear.config">clear_config()</link>,
|
||||
<link linkend="language.function.config.load">{config_load}</link>,
|
||||
<link linkend="api.config.load">config_load()</link>
|
||||
y
|
||||
<link linkend="api.get.template.vars">get_template_vars()</link>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
||||
@@ -2,22 +2,24 @@
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.get.registered.object">
|
||||
<refnamediv>
|
||||
<refname>get_registered_object</refname>
|
||||
<refpurpose></refpurpose>
|
||||
<refname>get_registered_object()</refname>
|
||||
<refpurpose>Este retorna una referencia para un objeto registrado.</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<title>Descripci<EFBFBD>n</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.
|
||||
necesita acesar directamente a un
|
||||
<link linkend="api.register.object">objeto registrado</link>.
|
||||
Ver <link linkend="advanced.features.objects">objects</link> para mas
|
||||
informaci<63>n;
|
||||
</para>
|
||||
<example>
|
||||
<title>get_registered_object</title>
|
||||
<title>get_registered_object()</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
@@ -33,6 +35,13 @@ function smarty_block_foo($params, &$smarty)
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Ver tambi<62>n
|
||||
<link linkend="api.register.object">register_object()</link>,
|
||||
<link linkend="api.unregister.object">unregister_object()</link>
|
||||
y
|
||||
<link linkend="advanced.features.objects">objects section</link>
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
||||
@@ -2,19 +2,18 @@
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.get.template.vars">
|
||||
<refnamediv>
|
||||
<refname>get_template_vars</refname>
|
||||
<refpurpose></refpurpose>
|
||||
<refname>get_template_vars()</refname>
|
||||
<refpurpose>Retorna el valor asignado a una variable</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<title>descripci<EFBFBD>n</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<EFBFBD>metro dado, un arreglo de todas las variables asignadas es
|
||||
retornado.
|
||||
Si no tiene un par<61>metro dado, un arreglo de todas las variables
|
||||
<link linkend="api.assign">asignadas</link> es retornado.
|
||||
</para>
|
||||
<example>
|
||||
<title>get_template_vars</title>
|
||||
@@ -33,6 +32,17 @@ print_r($tpl_vars);
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Ver tambi<62>n <link linkend="api.assign">assign()</link>,
|
||||
<link linkend="language.function.assign">{assign}</link>,
|
||||
<link linkend="api.assign.by.ref">assign_by_ref()</link>,
|
||||
<link linkend="api.append">append()</link>,
|
||||
<link linkend="api.clear.assign">clear_assign()</link>,
|
||||
<link linkend="api.clear.all.assign">clear_all_assign()</link>
|
||||
y
|
||||
<link linkend="api.get.config.vars">get_config_vars()</link>
|
||||
</para>
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.is.cached">
|
||||
<refnamediv>
|
||||
<refname>is_cached</refname>
|
||||
<refpurpose></refpurpose>
|
||||
<refname>is_cached()</refname>
|
||||
<refpurpose>Retorna true si hay cache valido para ese template</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<title>Descripci<EFBFBD>n </title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>is_cached</methodname>
|
||||
<methodparam><type>string</type><parameter>template</parameter></methodparam>
|
||||
@@ -14,12 +14,12 @@
|
||||
<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.
|
||||
ver tambi<62>n <link linkend="caching">caching section</link>.
|
||||
</para>
|
||||
<example>
|
||||
<title>is_cached</title>
|
||||
<title>is_cached()</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
@@ -35,9 +35,10 @@ $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.
|
||||
Usted tambi<62>n puede pasar un identificador de $cache como un
|
||||
segundo par<61>metro opcional en el caso que usted quiera
|
||||
<link linkend="caching.multiple.caches">multiples caches</link>
|
||||
para el template dado.
|
||||
</para>
|
||||
<para>
|
||||
Usted puede proporcionar el identidicador como un tercer parametro
|
||||
@@ -45,12 +46,13 @@ $smarty->display("index.tpl");
|
||||
<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>
|
||||
Si usted no quiere pasar el
|
||||
<link linkend="variable.compile.id">identificador de cache</link>
|
||||
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>
|
||||
<title>is_cached() con templates con multiple-cache</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
@@ -83,6 +85,14 @@ $smarty->display("index.tpl", "FrontPage");
|
||||
<literal>is_cached</literal> retorna true.
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
Ver tambi<62>n
|
||||
<link linkend="api.clear.cache">clear_cache()</link>,
|
||||
<link linkend="api.clear.all.cache">clear_all_cache()</link>,
|
||||
y
|
||||
<link linkend="caching">caching section</link>.
|
||||
</para>
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
||||
@@ -2,18 +2,17 @@
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.load.filter">
|
||||
<refnamediv>
|
||||
<refname>load_filter</refname>
|
||||
<refpurpose></refpurpose>
|
||||
<refname>load_filter()</refname>
|
||||
<refpurpose>Carga un filtro de plugin</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<title> Descripci<63>n</title>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>load_filter</methodname>
|
||||
<methodparam><type>string</type><parameter>type</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>name</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Esta funci<63>n puede ser usada para cargar un filtro de plugin.
|
||||
El primer argumento especif<69>ca el tipo de filtro a cargar y puede
|
||||
ser uno de los siguientes: 'pre', 'post', o 'output'. El segundo
|
||||
argumento especif<69>ca el nombre del filtro del plugin, por ejemplo,
|
||||
@@ -31,6 +30,16 @@ $smarty->load_filter('output', 'compress'); // load output filter named 'compres
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Ver tambi<62>n
|
||||
<link linkend="api.register.prefilter">register_prefilter()</link>,
|
||||
<link linkend="api.register.postfilter">register_postfilter()</link>,
|
||||
<link linkend="api.register.outputfilter">register_outputfilter()</link>,
|
||||
<link linkend="variable.autoload.filters">$autoload_filters</link>
|
||||
y
|
||||
<link linkend="advanced.features">Advanced features</link>.
|
||||
</para>
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.register.block">
|
||||
<refnamediv>
|
||||
<refname>register_block</refname>
|
||||
<refpurpose></refpurpose>
|
||||
<refname>register_block()</refname>
|
||||
<refpurpose>Registra dinamicamente bloques de funciones de plugins </refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<title>Descripci<EFBFBD>n</title>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>register_block</methodname>
|
||||
<methodparam><type>string</type><parameter>name</parameter></methodparam>
|
||||
@@ -38,11 +38,11 @@
|
||||
plugins </link> para saber como usar las propiedades.
|
||||
</para>
|
||||
<example>
|
||||
<title>register_block</title>
|
||||
<title>register_block()</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$smarty->register_block("translate", "do_translation");
|
||||
$smarty->register_block('translate', 'do_translation');
|
||||
|
||||
function do_translation ($params, $content, &$smarty, &$repeat)
|
||||
{
|
||||
@@ -67,6 +67,13 @@ Hello, world!
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Ver tambi<62>n
|
||||
<link linkend="api.unregister.block">unregister_block()</link>
|
||||
y
|
||||
<link linkend="plugins.block.functions">Plugin Block Functions</link>.
|
||||
</para>
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
<refentry id="api.register.compiler.function">
|
||||
<refnamediv>
|
||||
<refname>register_compiler_function</refname>
|
||||
<refpurpose></refpurpose>
|
||||
<refpurpose>Registra dinamicamente un plugin de una funcion compiladora</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<title>Descripci<EFBFBD>n </title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>register_compiler_function</methodname>
|
||||
<methodparam><type>string</type><parameter>name</parameter></methodparam>
|
||||
@@ -14,29 +14,41 @@
|
||||
<methodparam><type>bool</type><parameter>cacheable</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Use esto para registrar din<69>micamente una funci<63>n compiladora
|
||||
de plugin. Pase el nombre de la funci<EFBFBD>n compiladora, seguido
|
||||
por la funci<63>n PHP que implemente esto.
|
||||
Pase el nombre de la
|
||||
<link linkend="plugins.compiler.functions">funci<EFBFBD>n compiladora</link>,
|
||||
seguido por la funci<63>n PHP que implemente esto.
|
||||
</para>
|
||||
<para>
|
||||
La llamada a la funcion-php <parameter>impl</parameter> puede ser
|
||||
(a) una cadena conteniendo el nombre de la funci<63>n o
|
||||
(b) un arreglo en el formato
|
||||
<literal>array(&$object, $method)</literal> con
|
||||
<literal>&$object</literal> siendo una referencia para
|
||||
un objeto y <literal>$method</literal> siendo una cadena conteniendo
|
||||
el nombre del m<>todo o
|
||||
(c) un arreglo en el formato
|
||||
<literal>array(&$class, $method)</literal> con
|
||||
<literal>$class</literal> siendo un nombre de
|
||||
clase y <literal>$method</literal> siendo el m<>todo de esta clase.
|
||||
</para>
|
||||
</para>
|
||||
<orderedlist numeration="loweralpha">
|
||||
<listitem>
|
||||
<para>
|
||||
a una cadena conteniendo el nombre de la funci<63>n
|
||||
</para>
|
||||
</listitem><listitem>
|
||||
<para>un arreglo con la forma <literal>array(&$object, $method)</literal> con
|
||||
<literal>&$object</literal> siendo una referencia para un objeto y
|
||||
<literal>$method</literal> siendo una cadena conteniendo el nombre del m<>todo
|
||||
</para>
|
||||
</listitem><listitem>
|
||||
<para>un arreglo con la forma
|
||||
<literal>array(&$class, $method)</literal> con
|
||||
<literal>$class</literal> siendo el nombre de una clase y
|
||||
<literal>$method</literal> siendo el m<>todo de esta clase.
|
||||
</para>
|
||||
</listitem>
|
||||
</orderedlist>
|
||||
<para>
|
||||
<parameter>cacheable</parameter> puede ser omitido en la mayoria
|
||||
de los casos.
|
||||
Vea <link linkend="caching.cacheable">Controlando modos de Salida de
|
||||
<parameter>cacheable</parameter> puede ser omitido en la mayoria de los casos.
|
||||
Vea <link linkend="caching.cacheable">Controlando modos de Salida de
|
||||
Cache de los Plugins</link> para obtener mayor informaci<63>n.
|
||||
</para>
|
||||
<para>
|
||||
Ver tambi<62>n <link linkend="api.unregister.compiler.function">unregister_compiler_function() </link>
|
||||
y <link linkend="plugins.compiler.functions">Plugin Compiler Functions</link>.
|
||||
</para>
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
||||
@@ -2,50 +2,60 @@
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.register.function">
|
||||
<refnamediv>
|
||||
<refname>register_function</refname>
|
||||
<refpurpose></refpurpose>
|
||||
<refname>register_function()</refname>
|
||||
<refpurpose>Registra dinamicamente un plugin de funci<63>n para un template</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<title>Descripci<EFBFBD>n</title>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>register_function</methodname>
|
||||
<methodparam><type>string</type><parameter>name</parameter></methodparam>
|
||||
<methodparam><type>mixed</type><parameter>impl</parameter></methodparam>
|
||||
<methodparam><type>bool</type><parameter>cacheable</parameter></methodparam>
|
||||
<methodparam><type>mixed</type><parameter>cache_attrs</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>bool</type><parameter>cacheable</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>mixed</type><parameter>cache_attrs</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Use este para registrar funciones de plugins din<69>micamente para
|
||||
el template. Pase en el template el nombre de la funci<63>n, seguido
|
||||
Pase en el template el nombre de la funci<63>n, seguido
|
||||
por el nombre de la funci<63>n PHP que implementa esto.
|
||||
</para>
|
||||
<para>
|
||||
La llamada a la funcion-php <parameter>impl</parameter> puede ser
|
||||
(a) una cadena conteniendo el nombre de la funci<63>n o
|
||||
(b) un arreglo en el formato
|
||||
<literal>array(&$object, $method)</literal> con
|
||||
<literal>&$object</literal> siendo una referencia para
|
||||
un objeto y <literal>$method</literal> siendo una cadena
|
||||
conteniendo el nombre del m<>todo o
|
||||
(c) un arreglo en el formato
|
||||
<literal>array(&$class, $method)</literal> con
|
||||
<literal>$class</literal> siendo un nombre de clase y
|
||||
<literal>$method</literal> siendo un m<>todo de esta clase.
|
||||
</para>
|
||||
La llamada a la funcion-php <parameter>impl</parameter> puede ser:
|
||||
</para>
|
||||
<orderedlist numeration="loweralpha">
|
||||
<listitem>
|
||||
<para>
|
||||
a una cadena conteniendo el nombre de la funci<63>n o
|
||||
</para>
|
||||
</listitem><listitem>
|
||||
<para>
|
||||
un arreglo con la forma
|
||||
<literal>array(&$object, $method)</literal> con
|
||||
<literal>&$object</literal> siendo una referencia para un objeto y
|
||||
<literal>$method</literal> siendo una cadena conteniendo el nombre del m<>todo
|
||||
</para>
|
||||
</listitem><listitem>
|
||||
<para>
|
||||
un arreglo con la forma <literal>array(&$class, $method)</literal>
|
||||
con <literal>$class</literal> siendo el nombre de una clase y
|
||||
<literal>$method</literal> siendo un metodo de esa clase.
|
||||
</para>
|
||||
</listitem>
|
||||
</orderedlist>
|
||||
|
||||
<para>
|
||||
<parameter>cacheable</parameter> y <parameter>cache_attrs</parameter>
|
||||
pueden ser omitidos en la mayoria de los casos.
|
||||
Vea <link linkend="caching.cacheable">Controlando modos de Salida Cache de
|
||||
los Plugins</link> para obtener mayores informes.
|
||||
<parameter>cacheable</parameter> y <parameter>cache_attrs</parameter> pueden ser omitidos
|
||||
en la mayoria de los caasos.
|
||||
Vea <link linkend="caching.cacheable">Controlando modos de Salida Cache de
|
||||
los Plugins</link> para obtener mayores informes.
|
||||
</para>
|
||||
<example>
|
||||
<title>register_function</title>
|
||||
<title>register_function()</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$smarty->register_function("date_now", "print_current_date");
|
||||
$smarty->register_function('date_now', 'print_current_date');
|
||||
|
||||
function print_current_date($params)
|
||||
function print_current_date($params, &$smarty)
|
||||
{
|
||||
if(empty($params['format'])) {
|
||||
$format = "%b %e, %Y";
|
||||
@@ -54,12 +64,27 @@ function print_current_date($params)
|
||||
return strftime($format,time());
|
||||
}
|
||||
}
|
||||
// ahora usted puede usar eso en el Smarty para mostrar la fecha actual:
|
||||
// {date_now} o, {date_now format="%Y/%m/%d"} para formatearle.
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
y en el template
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{date_now}
|
||||
|
||||
{* or to format differently *}
|
||||
{date_now format="%Y/%m/%d"}
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
<para>
|
||||
Ver tambi<62>n <link linkend="api.unregister.function">unregister_function()</link>
|
||||
y <link linkend="plugins.functions">Plugin functions</link>.
|
||||
</para>
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
||||
@@ -2,50 +2,76 @@
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.register.modifier">
|
||||
<refnamediv>
|
||||
<refname>register_modifier</refname>
|
||||
<refpurpose></refpurpose>
|
||||
<refname>register_modifier()</refname>
|
||||
<refpurpose>mofidica din<69>micamente plugins registrados</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<title>Descripci<EFBFBD>n</title>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>register_modifier</methodname>
|
||||
<methodparam><type>string</type><parameter>name</parameter></methodparam>
|
||||
<methodparam><type>mixed</type><parameter>impl</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Use este para modificar din<69>micamente plugins registrados.
|
||||
Pase en el template el nombre del modificador, seguido de la
|
||||
funci<63>n PHP que implemente esto.
|
||||
</para>
|
||||
<para>
|
||||
La llamada de la funcion-php <parameter>impl</parameter> puede ser
|
||||
(a) una cadena conteniendo el nombre de la funci<63>n o
|
||||
(b) un arreglo en el formato
|
||||
<literal>array(&$object, $method)</literal> con
|
||||
<literal>&$object</literal> siendo una referencia para
|
||||
un objeto y <literal>$method</literal> siendo una cadena conteniendo
|
||||
el nombre del m<>todo o
|
||||
(c) un arreglo en el formato
|
||||
<literal>array(&$class, $method)</literal> con
|
||||
<literal>$class</literal> siendo un nombre de clase y
|
||||
<literal>$method</literal> siendo un m<>todo de esta clase.
|
||||
</para>
|
||||
<orderedlist numeration="loweralpha">
|
||||
<listitem>
|
||||
<para>una cadena conteniendo el nombre de la funci<63>n
|
||||
</para>
|
||||
</listitem><listitem>
|
||||
<para>un arreglo con la forma <literal>array(&$object, $method)</literal> con
|
||||
<literal>&$object</literal> siendo una referencia para un objeto y
|
||||
<literal>$method</literal> siendo una cadena conteniendo el nombre de un metodo
|
||||
</para>
|
||||
</listitem><listitem>
|
||||
<para>
|
||||
un arreglo con la forma
|
||||
<literal>array(&$class, $method)</literal> con
|
||||
<literal>$class</literal> siendo el nombre de una clase y
|
||||
<literal>$method</literal> siendo un metodo de esta clase.
|
||||
</para>
|
||||
</listitem>
|
||||
</orderedlist>
|
||||
<example>
|
||||
<title>register_modifier</title>
|
||||
<programlisting role="php">
|
||||
<title>register_modifier()</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
// let's map PHP's stripslashes function to a Smarty modifier.
|
||||
$smarty->register_modifier('sslash', 'stripslashes');
|
||||
|
||||
$smarty->register_modifier("sslash", "stripslashes");
|
||||
|
||||
// now you can use {$var|sslash} to strip slashes from variables
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</programlisting>
|
||||
<para>template</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
<?php
|
||||
{* use 'sslash' to strip slashes from variables *}
|
||||
{$var|sslash}
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
|
||||
</example>
|
||||
<para>
|
||||
Ver Tambi<62>n
|
||||
<link linkend="api.unregister.modifier">unregister_modifier()</link>,
|
||||
<link linkend="api.register.function">register_function()</link>,
|
||||
<link linkend="language.modifiers">modifiers</link>,
|
||||
<link linkend="plugins">Extending Smarty with plugins</link>
|
||||
y
|
||||
<link linkend="plugins.modifiers">Creating Plugin modifiers</link>,
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.register.object">
|
||||
<refnamediv>
|
||||
<refname>register_object</refname>
|
||||
<refpurpose></refpurpose>
|
||||
<refname>register_object()</refname>
|
||||
<refpurpose>Registr un objeto para usar en el template</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<title>Descripci<EFBFBD>n </title>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>register_object</methodname>
|
||||
<methodparam><type>string</type><parameter>object_name</parameter></methodparam>
|
||||
@@ -16,9 +16,13 @@
|
||||
<methodparam><type>array</type><parameter>block_methods</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Este es para registrar un objeto para usar en el template.
|
||||
Vea <link linkend="advanced.features.objects">object section</link>
|
||||
del manual para ejemplos.
|
||||
Vea <link linkend="advanced.features.objects">object section</link> para ejemplos.
|
||||
</para>
|
||||
<para>
|
||||
Vea tambi<62>n
|
||||
<link linkend="api.get.registered.object">get_registered_object()</link>,
|
||||
y
|
||||
<link linkend="api.unregister.object">unregister_object()</link>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
@@ -2,36 +2,59 @@
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.register.outputfilter">
|
||||
<refnamediv>
|
||||
<refname>register_outputfilter</refname>
|
||||
<refpurpose></refpurpose>
|
||||
<refname>register_outputfilter()</refname>
|
||||
<refpurpose>Registra dinamicamente filtros de salida</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<title>Descripci<EFBFBD>n </title>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>register_outputfilter</methodname>
|
||||
<methodparam><type>mixed</type><parameter>function</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Use este para registrar din<69>micamente filtros de salida para
|
||||
operaciones en la salida del template antes de mostrarlo.
|
||||
Use este para registrar din<69>micamente <link
|
||||
linkend="plugins.outputfilters">filtros de salida</link> para
|
||||
operaciones en la <link linkend="api.display">salida</link>
|
||||
del template antes de mostrarlo.
|
||||
Vea <link linkend="advanced.features.outputfilters">Filtros de
|
||||
Salida de Templates</link> para mayores informes de como
|
||||
configurar una funci<63>n de filtro de salida.
|
||||
</para>
|
||||
<para>
|
||||
La llamada de la funcion-php <parameter>function</parameter>
|
||||
puede ser
|
||||
(a) una cadena conteniendo un nombre de funci<63>n o
|
||||
(b) un arreglo en el formato
|
||||
<literal>array(&$object, $method)</literal> con
|
||||
<literal>&$object</literal> siendo una referencia para
|
||||
un objeto y <literal>$method</literal> siendo una cadena
|
||||
conteniendo el nombre del m<>todo o
|
||||
(c) un arreglo en el formato
|
||||
<literal>array(&$class, $method)</literal> con
|
||||
<literal>$class</literal> siendo el nombre de la clase y
|
||||
<literal>$method</literal> siendo un m<>todo de esta clase.
|
||||
</para>
|
||||
La llamada de la funcion-php <parameter>function</parameter> puede ser
|
||||
</para>
|
||||
<orderedlist numeration="loweralpha">
|
||||
<listitem>
|
||||
<para>
|
||||
una cadena conteniendo un nombre de funci<63>n
|
||||
</para>
|
||||
</listitem><listitem>
|
||||
<para>
|
||||
un arreglo con la forma
|
||||
<literal>array(&$object, $method)</literal> con
|
||||
<literal>&$object</literal> siendo referencia a un objeto y
|
||||
<literal>$method</literal> siendo una cadena conteniendo el nombre de un metodo
|
||||
</para>
|
||||
</listitem><listitem>
|
||||
<para>
|
||||
un arreglo con la forma
|
||||
<literal>array(&$class, $method)</literal> con
|
||||
<literal>$class</literal> siendo el nombre de la clase y
|
||||
<literal>$method</literal> siendo un m<>todo de esta clase.
|
||||
</para>
|
||||
</listitem>
|
||||
</orderedlist>
|
||||
<para>
|
||||
Vea tambi<62>n
|
||||
<link linkend="api.unregister.outputfilter">unregister_outputfilter()</link>,
|
||||
<link linkend="api.register.prefilter">register_prefilter()</link>,
|
||||
<link linkend="api.register.postfilter">register_postfilter()</link>,
|
||||
<link linkend="api.load.filter">load_filter()</link>,
|
||||
<link linkend="variable.autoload.filters">$autoload_filters</link>
|
||||
y
|
||||
<link linkend="advanced.features.outputfilters">template output filters</link>.
|
||||
</para>
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
||||
@@ -2,36 +2,57 @@
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.register.postfilter">
|
||||
<refnamediv>
|
||||
<refname>register_postfilter</refname>
|
||||
<refpurpose></refpurpose>
|
||||
<refname>register_postfilter()</refname>
|
||||
<refpurpose>Resgistr dinamicamente postfiltros</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<title> Descripci<63>n</title>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>register_postfilter</methodname>
|
||||
<methodparam><type>mixed</type><parameter>function</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Use esto para registrar din<69>micamente postfiltros para
|
||||
Use esto para registrar din<69>micamente <link
|
||||
linkend="advanced.features.postfilters">postfiltros</link> para
|
||||
correr templates directos despu<70>s de ser compilados.
|
||||
Vea <link linkend="advanced.features.postfilters">postfiltros
|
||||
de template</link> para mayores informes de como configurar
|
||||
funciones de postfiltering.
|
||||
</para>
|
||||
<para>
|
||||
La llamada de la funcion-php <parameter>function</parameter>
|
||||
puede ser:
|
||||
(a) una cadena conteniendo un nombre de funci<63>n o
|
||||
(b) un arreglo con el formato
|
||||
<literal>array(&$object, $method)</literal> con
|
||||
<literal>&$object</literal> siendo una referencia para un
|
||||
objeto y <literal>$method</literal> siendo una cadena conteniendo
|
||||
el nombre de un m<>todo o
|
||||
(c) un arreglo con el formato
|
||||
<literal>array(&$class, $method)</literal> con
|
||||
<literal>$class</literal> siendo un nombre de clase y
|
||||
<literal>$method</literal> siendo un m<>todo de esta clase.
|
||||
</para>
|
||||
La llamada de la funcion-php <parameter>function</parameter> puede ser:
|
||||
</para>
|
||||
<orderedlist numeration="loweralpha">
|
||||
<listitem>
|
||||
<para>
|
||||
una cadena conteniendo un nombre de funci<63>n
|
||||
</para>
|
||||
</listitem><listitem>
|
||||
<para>
|
||||
un arreglo con la forma
|
||||
<literal>array(&$object, $method)</literal> con
|
||||
<literal>&$object</literal> siendo una referencia para un
|
||||
objeto y <literal>$method</literal> siendo una cadena conteniendo
|
||||
el nombre de un m<>todo
|
||||
</para>
|
||||
</listitem><listitem>
|
||||
<para>
|
||||
un arreglo con la forma
|
||||
<literal>array(&$class, $method)</literal> con
|
||||
<literal>$class</literal> siendo un nombre de clase y
|
||||
<literal>$method</literal> siendo un m<>todo de esta clase.
|
||||
</para>
|
||||
</listitem>
|
||||
</orderedlist>
|
||||
<para>
|
||||
Vea Tambi<62>n
|
||||
<link linkend="api.unregister.postfilter">unregister_postfilter()</link>,
|
||||
<link linkend="api.register.prefilter">register_prefilter()</link>,
|
||||
<link linkend="api.register.outputfilter">register_ouputfilter()</link>,
|
||||
<link linkend="api.load.filter">load_filter()</link>,
|
||||
<link linkend="variable.autoload.filters">$autoload_filters</link>
|
||||
y <link linkend="advanced.features.outputfilters">template output filters</link>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
||||
@@ -2,35 +2,57 @@
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.register.prefilter">
|
||||
<refnamediv>
|
||||
<refname>register_prefilter</refname>
|
||||
<refpurpose></refpurpose>
|
||||
<refname>register_prefilter()</refname>
|
||||
<refpurpose>Registra dinamicamente prefiltros</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<title> Descripci<63>n</title>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>register_prefilter</methodname>
|
||||
<methodparam><type>mixed</type><parameter>function</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Use esto para registrar prefiltros din<69>micamente para correr
|
||||
templates antes de que estos sean compilados. Vea
|
||||
<link linkend="advanced.features.prefilters">template prefilters</link>
|
||||
Use esto para registrar
|
||||
<link linkend="advanced.features.prefilters">prefiltros</link>
|
||||
din<EFBFBD>micamente para correr templates antes de que estos sean compilados.
|
||||
Vea <link linkend="advanced.features.prefilters">template prefilters</link>
|
||||
para mayores informes de como configurar una funci<63>n de prefiltering.
|
||||
</para>
|
||||
<para>
|
||||
La llamada de la funcion-php <parameter>function</parameter>
|
||||
puede ser:
|
||||
(a) una cadena conteniendo un nombre de funci<63>n o
|
||||
(b) un arreglo con el formato
|
||||
<literal>array(&$object, $method)</literal> con
|
||||
<literal>&$object</literal> siendo una referencia para un
|
||||
objeto y <literal>$method</literal> siendo una cadena conteniendo
|
||||
el nombre de un m<>todo o
|
||||
(c) un arreglo con el formato
|
||||
<literal>array(&$class, $method)</literal> con
|
||||
<literal>$class</literal> siendo un nombre de clase y
|
||||
<literal>$method</literal> siendo un m<>todo de esta clase.
|
||||
La llamada de la funcion-php <parameter>function</parameter> puede ser:
|
||||
</para>
|
||||
<orderedlist numeration="loweralpha">
|
||||
<listitem>
|
||||
<para>
|
||||
una cadena conteniendo un nombre de funci<63>n
|
||||
</para>
|
||||
</listitem><listitem>
|
||||
<para>
|
||||
un arreglo con la forma
|
||||
<literal>array(&$object, $method)</literal> con
|
||||
<literal>&$object</literal> siendo una referencia para un
|
||||
objeto y <literal>$method</literal> siendo una cadena conteniendo
|
||||
el nombre de un m<>todo
|
||||
</para>
|
||||
</listitem><listitem>
|
||||
<para>
|
||||
un arreglo con la forma
|
||||
<literal>array(&$class, $method)</literal> con
|
||||
<literal>$class</literal> siendo un nombre de clase y
|
||||
<literal>$method</literal> siendo un m<>todo de esta clase.
|
||||
</para>
|
||||
</listitem>
|
||||
</orderedlist>
|
||||
|
||||
<para>
|
||||
Ver tambi<62>n
|
||||
<link linkend="api.unregister.prefilter">unregister_prefilter()</link>,
|
||||
<link linkend="api.register.postfilter">register_postfilter()</link>,
|
||||
<link linkend="api.register.outputfilter">register_ouputfilter()</link>,
|
||||
<link linkend="api.load.filter">load_filter()</link>,
|
||||
<link linkend="variable.autoload.filters">$autoload_filters</link>
|
||||
y <link linkend="advanced.features.outputfilters">template output filters</link>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
||||
@@ -3,17 +3,18 @@
|
||||
<refentry id="api.register.resource">
|
||||
<refnamediv>
|
||||
<refname>register_resource</refname>
|
||||
<refpurpose></refpurpose>
|
||||
<refpurpose>Registra dinamicamente un plugin de recurso</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<title>Descripci<EFBFBD>n </title>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>register_resource</methodname>
|
||||
<methodparam><type>string</type><parameter>name</parameter></methodparam>
|
||||
<methodparam><type>array</type><parameter>resource_funcs</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Use esto para registrar din<69>micamente un recurso de plugin con Smarty.
|
||||
Use esto para registrar din<69>micamente un
|
||||
<link linkend="template.resources">recurso de plugin</link> con Smarty.
|
||||
Pase el nombre o el recurso y o el arreglo de funciones que implementa
|
||||
esto. Vea <link linkend="template.resources">template resources</link>
|
||||
para mayor informaci<63>n de como configurar una funci<63>n para mandar llamar
|
||||
@@ -42,14 +43,19 @@
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$smarty->register_resource("db", array("db_get_template",
|
||||
"db_get_timestamp",
|
||||
"db_get_secure",
|
||||
"db_get_trusted"));
|
||||
$smarty->register_resource('db', array('db_get_template',
|
||||
'db_get_timestamp',
|
||||
'db_get_secure',
|
||||
'db_get_trusted'));
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Ver tambi<62>n <link linkend="api.unregister.resource">unregister_resource()</link>
|
||||
y <link linkend="template.resources">template resources</link>
|
||||
</para>
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
||||
@@ -2,20 +2,71 @@
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.template.exists">
|
||||
<refnamediv>
|
||||
<refname>template_exists</refname>
|
||||
<refpurpose></refpurpose>
|
||||
<refname>template_exists()</refname>
|
||||
<refpurpose>Verifica si el template especificado existe</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<title>Descripci<EFBFBD>n</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>template_exists</methodname>
|
||||
<methodparam><type>string</type><parameter>template</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Esta funci<63>n checa si el template especificado existe. Este puede
|
||||
aceptar un path para el template en el filesystem o un recurso de
|
||||
Este puede aceptar un path para el template en el filesystem o un recurso de
|
||||
cadena especificando el template.
|
||||
</para>
|
||||
<example>
|
||||
<title>template_exists()</title>
|
||||
<para>
|
||||
Este ejemplo utiliza $_GET['page'] este incluye el contenido del template. Si el
|
||||
template no existe entonces un error de pagina es deplegado en su lugar.
|
||||
</para>
|
||||
<para>
|
||||
El <filename>page_container.tpl</filename>
|
||||
</para>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<html>
|
||||
<head><title>{$title}</title></head>
|
||||
<body>
|
||||
{include file='page_top.tpl'}
|
||||
|
||||
{* include middle content page *}
|
||||
{include file=$page_mid}
|
||||
|
||||
{include file='page_footer.tpl'}
|
||||
</body>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
y el script PHP
|
||||
</para>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
// set the filename eg index.inc.tpl
|
||||
$mid_template = $_GET['page'].'.inc.tpl';
|
||||
|
||||
if( !$smarty->template_exists($mid_template) ){
|
||||
$mid_template = 'page_not_found.inc.tpl';
|
||||
}
|
||||
$smarty->assign('page_mid', $mid_template);
|
||||
|
||||
$smarty->display('page_container.tpl');
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Ver tambi<62>n
|
||||
<link linkend="api.display">display()</link>,
|
||||
<link linkend="api.fetch">fetch()</link>,
|
||||
<link linkend="language.function.include">{include}</link>
|
||||
y <link linkend="language.function.insert">{insert}</link>
|
||||
</para>
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
<refentry id="api.trigger.error">
|
||||
<refnamediv>
|
||||
<refname>trigger_error</refname>
|
||||
<refpurpose></refpurpose>
|
||||
<refpurpose>Despliega un mensaje de error</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<title> Descripci<63>n </title>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>trigger_error</methodname>
|
||||
<methodparam><type>string</type><parameter>error_msg</parameter></methodparam>
|
||||
@@ -15,10 +15,18 @@
|
||||
<para>
|
||||
Esta funci<63>n puede ser usada para la salida de un mensaje de error
|
||||
usando Smarty. El par<61>metro <parameter>level</parameter> es uno de
|
||||
los valores usados para la funci<63>n de php trigger_error(),
|
||||
los valores usados para la funci<63>n de php
|
||||
<ulink url="&url.php-manual;trigger_error">trigger_error()</ulink>,
|
||||
ex.: E_USER_NOTICE, E_USER_WARNING, etc.
|
||||
Por default es E_USER_WARNING.
|
||||
</para>
|
||||
<para>
|
||||
Ver tambi<62>n
|
||||
<link linkend="variable.error.reporting">$error_reporting</link>,
|
||||
<link linkend="chapter.debugging.console">debugging</link>
|
||||
y
|
||||
<link linkend="smarty.php.errors">Troubleshooting</link>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
||||
@@ -3,19 +3,26 @@
|
||||
<refentry id="api.unregister.block">
|
||||
<refnamediv>
|
||||
<refname>unregister_block</refname>
|
||||
<refpurpose></refpurpose>
|
||||
<refpurpose>Des-registra dinamicamente un plugin de bloque de funciones</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<title>Descripci<EFBFBD>n</title>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>unregister_block</methodname>
|
||||
<methodparam><type>string</type><parameter>name</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Use esto para des-registrar din<69>micamente un bloque de
|
||||
funciones de plugin. Pase en el bloque el
|
||||
<parameter>nombre</parameter> de la funci<63>n.
|
||||
Use esto para des-registrar din<69>micamente un
|
||||
<link linkend="plugins.block.functions">bloque de funciones de plugin</link>.
|
||||
Pase en el bloque el <parameter>nombre</parameter> de la funci<63>n.
|
||||
</para>
|
||||
<para>
|
||||
Ver tambi<62>n
|
||||
<link linkend="api.register.block">register_block()</link>
|
||||
y
|
||||
<link linkend="plugins.block.functions">Block Functions Plugins</link>.
|
||||
</para>
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
||||
@@ -2,19 +2,23 @@
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.unregister.compiler.function">
|
||||
<refnamediv>
|
||||
<refname>unregister_compiler_function</refname>
|
||||
<refpurpose></refpurpose>
|
||||
<refname>unregister_compiler_function()</refname>
|
||||
<refpurpose>des-registrar din<69>micamente una funci<63>n de compilaci<63>n</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<title>Descripci<EFBFBD>n </title>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>unregister_compiler_function</methodname>
|
||||
<methodparam><type>string</type><parameter>name</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Use este para des-registrar din<69>micamente una funci<63>n de compilaci<EFBFBD>n.
|
||||
pase el <parameter>nombre</parameter> de la funci<63>n compiladora.
|
||||
Pase el <parameter>nombre</parameter> de la funci<63>n compiladora.
|
||||
</para>
|
||||
<para>
|
||||
Ver tambi<62>n <link linkend="api.register.compiler.function">register_compiler_function() </link>
|
||||
y <link linkend="plugins.compiler.functions">Plugin Compiler Functions</link>.
|
||||
</para>
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
||||
@@ -2,21 +2,20 @@
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.unregister.function">
|
||||
<refnamediv>
|
||||
<refname>unregister_function</refname>
|
||||
<refpurpose></refpurpose>
|
||||
<refname>unregister_function()</refname>
|
||||
<refpurpose>des-registrar din<69>micamente una funci<63>n de plugin del template</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<title> Descripci<63>n</title>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>unregister_function</methodname>
|
||||
<methodparam><type>string</type><parameter>name</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Use esta para des-registrar din<69>micamente una funci<63>n de
|
||||
plugin del template. Pase en el template el nombre de la funci<63>n.
|
||||
Pase en el template el nombre de la funci<63>n.
|
||||
</para>
|
||||
<example>
|
||||
<title>unregister_function</title>
|
||||
<title>unregister_function()</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
@@ -28,6 +27,10 @@ $smarty->unregister_function("fetch");
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Ver tambi<62>n <link linkend="api.register.function">register_function() </link>.
|
||||
</para>
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
||||
@@ -2,21 +2,20 @@
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.unregister.modifier">
|
||||
<refnamediv>
|
||||
<refname>unregister_modifier</refname>
|
||||
<refpurpose></refpurpose>
|
||||
<refname>unregister_modifier()</refname>
|
||||
<refpurpose>des-registrar din<69>micamente un modificador de plugin</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<title>Descripci<EFBFBD>n </title>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>unregister_modifier</methodname>
|
||||
<methodparam><type>string</type><parameter>name</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Use este para des-registrar din<69>micamente un modificador de plugin.
|
||||
Pase en el template el nombre del modificador.
|
||||
</para>
|
||||
<example>
|
||||
<title>unregister_modifier</title>
|
||||
<title>unregister_modifier()</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
@@ -28,6 +27,11 @@ $smarty->unregister_modifier("strip_tags");
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Ver tambi<62>n <link linkend="api.register.modifier">register_modifier()</link>
|
||||
y <link linkend="plugins.modifiers">Plugin modifiers</link>,
|
||||
</para>
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
||||
@@ -2,18 +2,20 @@
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.unregister.object">
|
||||
<refnamediv>
|
||||
<refname>unregister_object</refname>
|
||||
<refpurpose></refpurpose>
|
||||
<refname>unregister_object()</refname>
|
||||
<refpurpose>Des-registra dinamicamente un objeto</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<title>Descripci<EFBFBD>n </title>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>unregister_object</methodname>
|
||||
<methodparam><type>string</type><parameter>object_name</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Use este para des-registrar un objeto.
|
||||
</para>
|
||||
<para>
|
||||
Ver tambi<62>n <link linkend="api.register.object">register_object()</link>
|
||||
y <link linkend="advanced.features.objects">objects section</link>
|
||||
</para>
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.unregister.outputfilter">
|
||||
<refnamediv>
|
||||
<refname>unregister_outputfilter</refname>
|
||||
<refpurpose></refpurpose>
|
||||
<refname>unregister_outputfilter()</refname>
|
||||
<refpurpose>des-registra din<69>micamente un filtro de salida</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<title> Descripci<63>n</title>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>unregister_outputfilter</methodname>
|
||||
<methodparam><type>string</type><parameter>function_name</parameter></methodparam>
|
||||
@@ -14,6 +14,11 @@
|
||||
<para>
|
||||
Use este para des-registrar din<69>micamente un filtro de salida.
|
||||
</para>
|
||||
<para>
|
||||
Ver tambi<62>n <link linkend="api.register.outputfilter">register_outputfilter()</link>
|
||||
y <link linkend="advanced.features.outputfilters">template output filters</link>.
|
||||
</para>
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
||||
@@ -2,18 +2,21 @@
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.unregister.postfilter">
|
||||
<refnamediv>
|
||||
<refname>unregister_postfilter</refname>
|
||||
<refpurpose></refpurpose>
|
||||
<refname>unregister_postfilter()</refname>
|
||||
<refpurpose>Des-registra dinamicamente un postfiltro</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<title>Descripci<EFBFBD>n </title>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>unregister_postfilter</methodname>
|
||||
<methodparam><type>string</type><parameter>function_name</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Use esto para des-registrar din<69>micamente un postfiltro.
|
||||
</para>
|
||||
<para>
|
||||
Ver tambi<62>n
|
||||
<link linkend="api.unregister.postfilter">register_postfilter()</link>
|
||||
y <link linkend="plugins.prefilters.postfilters">template post filters</link>.
|
||||
</para>
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
||||
@@ -2,18 +2,21 @@
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.unregister.prefilter">
|
||||
<refnamediv>
|
||||
<refname>unregister_prefilter</refname>
|
||||
<refpurpose></refpurpose>
|
||||
<refname>unregister_prefilter()</refname>
|
||||
<refpurpose>Des-registra dinamicamente un prefiltro</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<title>Descripci<EFBFBD>n </title>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>unregister_prefilter</methodname>
|
||||
<methodparam><type>string</type><parameter>function_name</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Use esto para des-registrar din<69>micamente un prefiltro.
|
||||
Ver tambi<62>n
|
||||
<link linkend="api.register.prefilter">register_prefilter()</link>
|
||||
y <link linkend="plugins.prefilters.postfilters">pre filters</link>.
|
||||
</para>
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
||||
@@ -2,21 +2,20 @@
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.unregister.resource">
|
||||
<refnamediv>
|
||||
<refname>unregister_resource</refname>
|
||||
<refpurpose></refpurpose>
|
||||
<refname>unregister_resource()</refname>
|
||||
<refpurpose>Des-registra dinamicamente un plugin de recurso</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<title> Descripci<63>n</title>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>unregister_resource</methodname>
|
||||
<methodparam><type>string</type><parameter>name</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Use esto para des-registrar din<69>micamente un recurso de plugin.
|
||||
Pase en el par<61>metro el nombre del recurso.
|
||||
</para>
|
||||
<example>
|
||||
<title>unregister_resource</title>
|
||||
<title>unregister_resource()</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
@@ -25,6 +24,13 @@ $smarty->unregister_resource("db");
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Ver tambi<62>n
|
||||
<link linkend="api.register.resource">register_resource()</link>
|
||||
y
|
||||
<link linkend="template.resources">template resources</link>
|
||||
</para>
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
||||
Reference in New Issue
Block a user