mirror of
https://github.com/smarty-php/smarty.git
synced 2025-11-02 21:31:48 +01:00
spanish docs initial commit
This commit is contained in:
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
|
||||
-->
|
||||
55
docs/es/programmers/api-functions/api-load-filter.xml
Normal file
55
docs/es/programmers/api-functions/api-load-filter.xml
Normal file
@@ -0,0 +1,55 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.load.filter">
|
||||
<refnamediv>
|
||||
<refname>load_filter</refname>
|
||||
<refpurpose></refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<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,
|
||||
'trim'.
|
||||
</para>
|
||||
<example>
|
||||
<title>loading filter plugins</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$smarty->load_filter('pre', 'trim'); // load prefilter named 'trim'
|
||||
$smarty->load_filter('pre', 'datefooter'); // load another prefilter named 'datefooter'
|
||||
$smarty->load_filter('output', 'compress'); // load output filter named 'compress'
|
||||
?>
|
||||
]]>
|
||||
</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
|
||||
-->
|
||||
91
docs/es/programmers/api-functions/api-register-block.xml
Normal file
91
docs/es/programmers/api-functions/api-register-block.xml
Normal file
@@ -0,0 +1,91 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.register.block">
|
||||
<refnamediv>
|
||||
<refname>register_block</refname>
|
||||
<refpurpose></refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>register_block</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>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Use este para registrar din<69>micamente bloques de funciones de
|
||||
plugins. Pase el bloque de nombres de funci<63>n, seguido por una
|
||||
llamada de funci<63>n PHP que implemente esto.
|
||||
</para>
|
||||
<para>
|
||||
La llamada de una funcion-php <parameter>impl</parameter>
|
||||
puede ser cualquier (a) cadena conteniendo el nombre de la
|
||||
funci<63>n o (b) un arreglo con el formato
|
||||
<literal>array(&$object, $method)</literal> con
|
||||
<literal>&$object</literal> siendo la referencia a un
|
||||
objeto y <literal>$method</literal> siendo una cadena
|
||||
conteniendo el nombre del 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>
|
||||
<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 de cache de los
|
||||
plugins </link> para saber como usar las propiedades.
|
||||
</para>
|
||||
<example>
|
||||
<title>register_block</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$smarty->register_block("translate", "do_translation");
|
||||
|
||||
function do_translation ($params, $content, &$smarty, &$repeat)
|
||||
{
|
||||
if (isset($content)) {
|
||||
$lang = $params['lang'];
|
||||
// do some translation with $content
|
||||
return $translation;
|
||||
}
|
||||
}
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Donde el template es:
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{* template *}
|
||||
{translate lang="br"}
|
||||
Hello, world!
|
||||
{/translate}
|
||||
]]>
|
||||
</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,61 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.register.compiler.function">
|
||||
<refnamediv>
|
||||
<refname>register_compiler_function</refname>
|
||||
<refpurpose></refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>register_compiler_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>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Use esto para registrar din<69>micamente una funci<63>n compiladora
|
||||
de plugin. Pase el nombre de la funci<63>n compiladora, 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>
|
||||
<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>
|
||||
</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
|
||||
-->
|
||||
84
docs/es/programmers/api-functions/api-register-function.xml
Normal file
84
docs/es/programmers/api-functions/api-register-function.xml
Normal file
@@ -0,0 +1,84 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.register.function">
|
||||
<refnamediv>
|
||||
<refname>register_function</refname>
|
||||
<refpurpose></refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<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>
|
||||
</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
|
||||
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>
|
||||
<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.
|
||||
</para>
|
||||
<example>
|
||||
<title>register_function</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$smarty->register_function("date_now", "print_current_date");
|
||||
|
||||
function print_current_date($params)
|
||||
{
|
||||
if(empty($params['format'])) {
|
||||
$format = "%b %e, %Y";
|
||||
} else {
|
||||
$format = $params['format'];
|
||||
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>
|
||||
</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-register-modifier.xml
Normal file
68
docs/es/programmers/api-functions/api-register-modifier.xml
Normal file
@@ -0,0 +1,68 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.register.modifier">
|
||||
<refnamediv>
|
||||
<refname>register_modifier</refname>
|
||||
<refpurpose></refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<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>
|
||||
<example>
|
||||
<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");
|
||||
|
||||
// now you can use {$var|sslash} to strip slashes from variables
|
||||
?>
|
||||
]]>
|
||||
</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
|
||||
-->
|
||||
44
docs/es/programmers/api-functions/api-register-object.xml
Normal file
44
docs/es/programmers/api-functions/api-register-object.xml
Normal file
@@ -0,0 +1,44 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.register.object">
|
||||
<refnamediv>
|
||||
<refname>register_object</refname>
|
||||
<refpurpose></refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>register_object</methodname>
|
||||
<methodparam><type>string</type><parameter>object_name</parameter></methodparam>
|
||||
<methodparam><type>object</type><parameter>object</parameter></methodparam>
|
||||
<methodparam><type>array</type><parameter>allowed_methods_properties</parameter></methodparam>
|
||||
<methodparam><type>boolean</type><parameter>format</parameter></methodparam>
|
||||
<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.
|
||||
</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
|
||||
-->
|
||||
@@ -0,0 +1,56 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.register.outputfilter">
|
||||
<refnamediv>
|
||||
<refname>register_outputfilter</refname>
|
||||
<refpurpose></refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<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.
|
||||
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>
|
||||
</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,56 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.register.postfilter">
|
||||
<refnamediv>
|
||||
<refname>register_postfilter</refname>
|
||||
<refpurpose></refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<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
|
||||
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>
|
||||
</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
|
||||
-->
|
||||
55
docs/es/programmers/api-functions/api-register-prefilter.xml
Normal file
55
docs/es/programmers/api-functions/api-register-prefilter.xml
Normal file
@@ -0,0 +1,55 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.register.prefilter">
|
||||
<refnamediv>
|
||||
<refname>register_prefilter</refname>
|
||||
<refpurpose></refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<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>
|
||||
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.
|
||||
</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
|
||||
-->
|
||||
74
docs/es/programmers/api-functions/api-register-resource.xml
Normal file
74
docs/es/programmers/api-functions/api-register-resource.xml
Normal file
@@ -0,0 +1,74 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.register.resource">
|
||||
<refnamediv>
|
||||
<refname>register_resource</refname>
|
||||
<refpurpose></refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<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.
|
||||
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
|
||||
templates.
|
||||
</para>
|
||||
<note>
|
||||
<title>Nota t<>cnica</title>
|
||||
<para>
|
||||
El nombre del recurso debe tener al menos dos caracteres de largo.
|
||||
Un nombre de recurso de un car<61>cter ser<65> ignorado y usado como parte
|
||||
del path del archivo como, $smarty->display('c:/path/to/index.tpl');
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
La php-funcion-array <parameter>resource_funcs</parameter> debe tener
|
||||
4 o 5 elementos. Con 4 elementos los elementos son las llamadas para
|
||||
las respectivas funciones de recurso "source", "timestamp", "secure"
|
||||
y "trusted". Con 5 elementos el primer elemento
|
||||
tiene que ser un objeto por referencia o un nombre de clase del objeto
|
||||
o una clase implementando el recurso y los 4 elementos siguientes tiene
|
||||
que ser los nombres de los m<>todos implementando "source", "timestamp",
|
||||
"secure" y "trusted".
|
||||
</para>
|
||||
<example>
|
||||
<title>register_resource</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$smarty->register_resource("db", array("db_get_template",
|
||||
"db_get_timestamp",
|
||||
"db_get_secure",
|
||||
"db_get_trusted"));
|
||||
?>
|
||||
]]>
|
||||
</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
|
||||
-->
|
||||
40
docs/es/programmers/api-functions/api-template-exists.xml
Normal file
40
docs/es/programmers/api-functions/api-template-exists.xml
Normal file
@@ -0,0 +1,40 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.template.exists">
|
||||
<refnamediv>
|
||||
<refname>template_exists</refname>
|
||||
<refpurpose></refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<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
|
||||
cadena especificando el template.
|
||||
</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
|
||||
-->
|
||||
43
docs/es/programmers/api-functions/api-trigger-error.xml
Normal file
43
docs/es/programmers/api-functions/api-trigger-error.xml
Normal file
@@ -0,0 +1,43 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.trigger.error">
|
||||
<refnamediv>
|
||||
<refname>trigger_error</refname>
|
||||
<refpurpose></refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>trigger_error</methodname>
|
||||
<methodparam><type>string</type><parameter>error_msg</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>level</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<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(),
|
||||
ex.: E_USER_NOTICE, E_USER_WARNING, etc.
|
||||
Por default es E_USER_WARNING.
|
||||
</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
|
||||
-->
|
||||
40
docs/es/programmers/api-functions/api-unregister-block.xml
Normal file
40
docs/es/programmers/api-functions/api-unregister-block.xml
Normal file
@@ -0,0 +1,40 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.unregister.block">
|
||||
<refnamediv>
|
||||
<refname>unregister_block</refname>
|
||||
<refpurpose></refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<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.
|
||||
</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
|
||||
-->
|
||||
@@ -0,0 +1,39 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.unregister.compiler.function">
|
||||
<refnamediv>
|
||||
<refname>unregister_compiler_function</refname>
|
||||
<refpurpose></refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<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<63>n.
|
||||
pase el <parameter>nombre</parameter> de la funci<63>n compiladora.
|
||||
</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
|
||||
-->
|
||||
@@ -0,0 +1,52 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.unregister.function">
|
||||
<refnamediv>
|
||||
<refname>unregister_function</refname>
|
||||
<refpurpose></refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<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.
|
||||
</para>
|
||||
<example>
|
||||
<title>unregister_function</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
// nosotros no queremos que el diseñador del template tenga acceso a
|
||||
// nuestros archivos de sistema
|
||||
|
||||
$smarty->unregister_function("fetch");
|
||||
?>
|
||||
]]>
|
||||
</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,52 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.unregister.modifier">
|
||||
<refnamediv>
|
||||
<refname>unregister_modifier</refname>
|
||||
<refpurpose></refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<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>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
// nosotros no queremos que el diseñador de template use strip tags
|
||||
// para los elementos
|
||||
|
||||
$smarty->unregister_modifier("strip_tags");
|
||||
?>
|
||||
]]>
|
||||
</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
|
||||
-->
|
||||
38
docs/es/programmers/api-functions/api-unregister-object.xml
Normal file
38
docs/es/programmers/api-functions/api-unregister-object.xml
Normal file
@@ -0,0 +1,38 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.unregister.object">
|
||||
<refnamediv>
|
||||
<refname>unregister_object</refname>
|
||||
<refpurpose></refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<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>
|
||||
</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,38 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.unregister.outputfilter">
|
||||
<refnamediv>
|
||||
<refname>unregister_outputfilter</refname>
|
||||
<refpurpose></refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>unregister_outputfilter</methodname>
|
||||
<methodparam><type>string</type><parameter>function_name</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Use este para des-registrar din<69>micamente un filtro de salida.
|
||||
</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
|
||||
-->
|
||||
@@ -0,0 +1,38 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.unregister.postfilter">
|
||||
<refnamediv>
|
||||
<refname>unregister_postfilter</refname>
|
||||
<refpurpose></refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<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>
|
||||
</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,38 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.unregister.prefilter">
|
||||
<refnamediv>
|
||||
<refname>unregister_prefilter</refname>
|
||||
<refpurpose></refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<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.
|
||||
</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
|
||||
-->
|
||||
@@ -0,0 +1,49 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.unregister.resource">
|
||||
<refnamediv>
|
||||
<refname>unregister_resource</refname>
|
||||
<refpurpose></refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<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>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$smarty->unregister_resource("db");
|
||||
?>
|
||||
]]>
|
||||
</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
|
||||
-->
|
||||
61
docs/es/programmers/api-variables.xml
Normal file
61
docs/es/programmers/api-variables.xml
Normal file
@@ -0,0 +1,61 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<chapter id="api.variables">
|
||||
<title>Variables</title>
|
||||
|
||||
&programmers.api-variables.variable-template-dir;
|
||||
&programmers.api-variables.variable-compile-dir;
|
||||
&programmers.api-variables.variable-config-dir;
|
||||
&programmers.api-variables.variable-plugins-dir;
|
||||
&programmers.api-variables.variable-debugging;
|
||||
&programmers.api-variables.variable-debug-tpl;
|
||||
&programmers.api-variables.variable-debugging-ctrl;
|
||||
&programmers.api-variables.variable-autoload-filters;
|
||||
&programmers.api-variables.variable-compile-check;
|
||||
&programmers.api-variables.variable-force-compile;
|
||||
&programmers.api-variables.variable-caching;
|
||||
&programmers.api-variables.variable-cache-dir;
|
||||
&programmers.api-variables.variable-cache-lifetime;
|
||||
&programmers.api-variables.variable-cache-handler-func;
|
||||
&programmers.api-variables.variable-cache-modified-check;
|
||||
&programmers.api-variables.variable-config-overwrite;
|
||||
&programmers.api-variables.variable-config-booleanize;
|
||||
&programmers.api-variables.variable-config-read-hidden;
|
||||
&programmers.api-variables.variable-config-fix-newlines;
|
||||
&programmers.api-variables.variable-default-template-handler-func;
|
||||
&programmers.api-variables.variable-php-handling;
|
||||
&programmers.api-variables.variable-security;
|
||||
&programmers.api-variables.variable-secure-dir;
|
||||
&programmers.api-variables.variable-security-settings;
|
||||
&programmers.api-variables.variable-trusted-dir;
|
||||
&programmers.api-variables.variable-left-delimiter;
|
||||
&programmers.api-variables.variable-right-delimiter;
|
||||
&programmers.api-variables.variable-compiler-class;
|
||||
&programmers.api-variables.variable-request-vars-order;
|
||||
&programmers.api-variables.variable-request-use-auto-globals;
|
||||
&programmers.api-variables.variable-error-reporting;
|
||||
&programmers.api-variables.variable-compile-id;
|
||||
&programmers.api-variables.variable-use-sub-dirs;
|
||||
&programmers.api-variables.variable-default-modifiers;
|
||||
&programmers.api-variables.variable-default-resource-type;
|
||||
</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,44 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="variable.autoload.filters">
|
||||
<title>$autoload_filters</title>
|
||||
<para>
|
||||
Si existe algun filtro que usted desea cargar en cada llamada de
|
||||
template, usted puede especificar cual variable usar y el Smarty
|
||||
ira autom<6F>ticamente a cargarlos para usted. La variable es un
|
||||
arreglo asociativo donde las llaves son tipos de filtro y los
|
||||
valores son arreglos de nombres de filtros.
|
||||
Por ejemplo:
|
||||
<informalexample>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$smarty->autoload_filters = array('pre' => array('trim', 'stamp'),
|
||||
'output' => array('convert'));
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</informalexample>
|
||||
</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
|
||||
-->
|
||||
48
docs/es/programmers/api-variables/variable-cache-dir.xml
Normal file
48
docs/es/programmers/api-variables/variable-cache-dir.xml
Normal file
@@ -0,0 +1,48 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="variable.cache.dir">
|
||||
<title>$cache_dir</title>
|
||||
<para>
|
||||
Este es el nombre del directorio donde los caches del template
|
||||
son almacenados. Por default es "./cache", esto significa que
|
||||
buscara el directorio de cache en el mismo directorio que ejecuta
|
||||
el scripts PHP. Usted puede usar tambi<62>n su propia funci<63>n habitual
|
||||
de mantenimiento de cache para manipular los archivos de cache, que
|
||||
ignorar<61> est<73> configuraci<63>n.
|
||||
</para>
|
||||
<note>
|
||||
<title>Nota T<>cnica</title>
|
||||
<para>
|
||||
Esta configuraci<63>n debe ser cualquiera de las dos, un path
|
||||
relativo o absoluto. include_path no es usado para escribir archivos.
|
||||
</para>
|
||||
</note>
|
||||
<note>
|
||||
<title>Nota T<>cnica</title>
|
||||
<para>
|
||||
No es recomendado colocar este directorio bajo el directorio
|
||||
document root de su servidor web.
|
||||
</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,33 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="variable.cache.handler.func">
|
||||
<title>$cache_handler_func</title>
|
||||
<para>
|
||||
Usted puede proporcionar una funci<63>n por default para manipular
|
||||
archivos de cache en vez de usar el metodo incrustado usando el
|
||||
$cache_dir. Para mayor detalle vea la secci<63>n
|
||||
<link linkend="section.template.cache.handler.func">
|
||||
cache handler function section</link>.
|
||||
</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,54 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="variable.cache.lifetime">
|
||||
<title>$cache_lifetime</title>
|
||||
<para>
|
||||
Este es la duraci<63>n del tiempo en segundos que un cache de template
|
||||
es valido. Una vez que este tiempo est<73> expirado, el cache sera
|
||||
regenerado. $caching debe ser asignado a "true" para $cache_lifetime
|
||||
hasta tener alg<6C>n prop<6F>sito. Un valor de -1 forza el cache a nunca
|
||||
expirar. Un valor de 0 forzara a que el cache sea siempre regenerado
|
||||
(bueno solo para probar, el m<>todo mas eficiente para desabilitar cache
|
||||
es asignar <link linkend="variable.caching">$caching</link> = false.)
|
||||
</para>
|
||||
<para>
|
||||
Si <link linkend="variable.force.compile">$force_compile</link>
|
||||
est<73> habilitado, los archivos de cache ser<65>n regenerados todo el
|
||||
tiempo, efectivamente desabilitando caching. Usted puede limpiar
|
||||
todos los archivos de cache con la funci<63>n
|
||||
<link linkend="api.clear.all.cache">clear_all_cache()</link>,
|
||||
o archivos individuales de cache (o grupos) con la funci<63>n
|
||||
<link linkend="api.clear.cache">clear_cache()</link>.
|
||||
</para>
|
||||
<note>
|
||||
<title>Nota T<>cnica</title>
|
||||
<para>
|
||||
Si usted quisiera dar a ciertos templates su propio tiempo de
|
||||
vida de cache, usted puede hacer esto asignando
|
||||
<link linkend="variable.caching">$caching</link> = 2, entonces
|
||||
determina $cache_lifetime a un <20>nico valor justo antes de llamar
|
||||
display() o fetch().
|
||||
</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,35 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="variable.cache.modified.check">
|
||||
<title>$cache_modified_check</title>
|
||||
<para>
|
||||
Si es asignado true, Smarty respetara el If-Modified-Since
|
||||
encabezado enviado para el cliente. Si el timestamp del
|
||||
archivo de cache no fue alterado desde la ultima visita,
|
||||
entonces un encabezado "304 Not Modified" sera enviado en
|
||||
vez del contenido.
|
||||
Esto funciona solamente en archivos de cache sin etiquetas
|
||||
<command>insert</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
|
||||
-->
|
||||
45
docs/es/programmers/api-variables/variable-caching.xml
Normal file
45
docs/es/programmers/api-variables/variable-caching.xml
Normal file
@@ -0,0 +1,45 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="variable.caching">
|
||||
<title>$caching</title>
|
||||
<para>
|
||||
Este informa al Smarty si hay o no salida de cache para el template.
|
||||
Por default tiene asignado 0, o desabilitado. Si su template genera
|
||||
contenido redundante, es necesario ligar el caching. Esto tendra un
|
||||
benefico significativo en el rendimiento. Usted puede tener multiples
|
||||
caches para el mismo template. Un valor de 1 o 2 caching habilitados.
|
||||
1 anuncia a Smarty para usar la variable actual $cache_lifetime hasta
|
||||
determinar si el cache expiro. Un valor 2 anuncia a Smarty para usar
|
||||
el valor cache_lifetime al tiempo en que le cache fue generado.
|
||||
De esta manera usted puede determinar el cache_lifetime inmediatamente
|
||||
antes de buscar el template para tener el control cuando este cache en
|
||||
particular expira.
|
||||
Vea tambi<62>n <link linkend="api.is.cached">is_cached</link>.
|
||||
</para>
|
||||
<para>
|
||||
Si $compile_check est<73> habilitado, el contenido del cache se regenerara
|
||||
si alguno de los dos templates o archivos de configuraci<63>n que son parte
|
||||
de este cache estuviera modificado. Si $force_compile est<73> habilitado,
|
||||
el contenido del cache siempre sera regenerado.
|
||||
</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
|
||||
-->
|
||||
43
docs/es/programmers/api-variables/variable-compile-check.xml
Normal file
43
docs/es/programmers/api-variables/variable-compile-check.xml
Normal file
@@ -0,0 +1,43 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="variable.compile.check">
|
||||
<title>$compile_check</title>
|
||||
<para>
|
||||
En cada llamada de la aplicaci<63>n PHP, Smarty prueba para ver si el
|
||||
template actual fue modificado (diferentes time stamp) desde la
|
||||
ultima compilaci<63>n. Si este fue modificado, se recompilara el template.
|
||||
Si el template no fue compilado, este ira a compilar de cualquier
|
||||
manera esa configuraci<63>n. Por default esta variable es determinada como
|
||||
true. Una vez que la aplicaci<63>n esta en producci<63>n (los templates no
|
||||
seran modificados), el paso compile_check no es necesario. asegurese de
|
||||
determinar $compile_check a "false" para un mejor funcionamiento.
|
||||
Note que si usted modifica est<73> para "false" y el archivo de template
|
||||
est<73> modificado, usted *no* vera los cambios desde el template hasta que
|
||||
no sea recompilado. Si el cache esta habilitado y compile_check est<73>
|
||||
habilitado, entonces los archivos de cache tienen que ser regenerados si
|
||||
el archivo de template es muy complejo o el archivo de configuraci<63>n fue
|
||||
actualizado.
|
||||
vea <link linkend="variable.force.compile">$force_compile</link>
|
||||
o <link linkend="api.clear.compiled.tpl">clear_compiled_tpl</link>.
|
||||
</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
|
||||
-->
|
||||
45
docs/es/programmers/api-variables/variable-compile-dir.xml
Normal file
45
docs/es/programmers/api-variables/variable-compile-dir.xml
Normal file
@@ -0,0 +1,45 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="variable.compile.dir">
|
||||
<title>$compile_dir</title>
|
||||
<para>
|
||||
Ese es el nombre del directorio donde los templates compilados
|
||||
est<73>n localizados, Por default est<73>n en "./templates_c", esto
|
||||
significa que lo buscara en el directorio de templates en el
|
||||
mismo directorio que esta ejecutando el script php.
|
||||
</para>
|
||||
<note>
|
||||
<title>Nota T<>cnica</title>
|
||||
<para>
|
||||
Esa configuraci<63>n debe ser un path relativo o un path
|
||||
absoluto. include_path no se usa para escribir archivos.
|
||||
</para>
|
||||
</note>
|
||||
<note>
|
||||
<title>Nota T<>cnica</title>
|
||||
<para>
|
||||
No es recomendado colocar este directorio bajo el directorio
|
||||
document root de su servidor web.
|
||||
</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
|
||||
-->
|
||||
31
docs/es/programmers/api-variables/variable-compile-id.xml
Normal file
31
docs/es/programmers/api-variables/variable-compile-id.xml
Normal file
@@ -0,0 +1,31 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="variable.compile.id">
|
||||
<title>$compile_id</title>
|
||||
<para>
|
||||
Identificador de compilaci<63>n persistente. Como una alternativa
|
||||
para pasar el mismo compile_id a cada llamada de funci<63>n, usted
|
||||
puede asignar este compile_id y este ser<65> usado implicitamente
|
||||
despu<70>s.
|
||||
</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,30 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="variable.compiler.class">
|
||||
<title>$compiler_class</title>
|
||||
<para>
|
||||
Especifica el nombre del compilador de clases que Smarty usara
|
||||
para compilar los templates. El default es 'Smarty_Compiler'.
|
||||
Solo para usuarios avanzados.
|
||||
</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,32 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="variable.config.booleanize">
|
||||
<title>$config_booleanize</title>
|
||||
<para>
|
||||
Si es asignado true, los valores del archivo de configuraci<63>n de
|
||||
on/true/yes y off/false/no se convierten en valores booleanos
|
||||
autom<6F>ticamente. De esta forma usted puede usar los valores en un
|
||||
template como: {if #foobar#} ... {/if}. Si foobar estuviera on,
|
||||
true o yes, la condici<63>n {if} se ejecutara. true es el default.
|
||||
</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
|
||||
-->
|
||||
39
docs/es/programmers/api-variables/variable-config-dir.xml
Normal file
39
docs/es/programmers/api-variables/variable-config-dir.xml
Normal file
@@ -0,0 +1,39 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="variable.config.dir">
|
||||
<title>$config_dir</title>
|
||||
<para>
|
||||
Este es el directorio usado para almacenar archivos de
|
||||
configuraci<63>n usados en los templates.
|
||||
El default es "./configs", esto significa que lo buscara
|
||||
en el directorio de templates en el mismo directorio que
|
||||
esta ejecutando el script php.
|
||||
</para>
|
||||
<note>
|
||||
<title>Nota T<>cnica</title>
|
||||
<para>
|
||||
No es recomendado colocar este directorio bajo el directorio
|
||||
document root de su servidor web.
|
||||
</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,30 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="variable.config.fix.newlines">
|
||||
<title>$config_fix_newlines</title>
|
||||
<para>
|
||||
Si es asignado true, mac y dos newlines (\r y \r\n) en el archivo de
|
||||
configuraci<63>n seran convertidos a \n cuando estos fueran interpretados.
|
||||
true es el defaut.
|
||||
</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,32 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="variable.config.overwrite">
|
||||
<title>$config_overwrite</title>
|
||||
<para>
|
||||
Si es asignado true, las variables leidas en el archivo de
|
||||
configuraci<63>n se sobreescribiran unas a otras. De lo contrario,
|
||||
las variables seran guardadas en un arreglo. Esto es <20>til si usted
|
||||
quiere almacenar arreglos de datos en archivos de configuracion,
|
||||
solamente lista tiempos de cada elemento m<>ltiplo. true por default.
|
||||
</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,33 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="variable.config.read.hidden">
|
||||
<title>$config_read_hidden</title>
|
||||
<para>
|
||||
Si es asignado true, esconde secciones (nombres de secciones comenzando
|
||||
con un periodo) en el archivo de configuraci<63>n pueden ser leidos del
|
||||
template. Tipicamente desearia esto como false, de esta forma usted puede
|
||||
almacenar datos sensibles en el archivo de configuraci<63>n como un par<61>metro
|
||||
de base de datos y sin preocuparse que el template los carge.
|
||||
false es el default.
|
||||
</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
|
||||
-->
|
||||
30
docs/es/programmers/api-variables/variable-debug-tpl.xml
Normal file
30
docs/es/programmers/api-variables/variable-debug-tpl.xml
Normal file
@@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="variable.debug.tpl">
|
||||
<title>$debug_tpl</title>
|
||||
<para>
|
||||
Este es el nombre del archivo de template usado para el debug
|
||||
de la consola. Por default, es nombrado debug.tpl y esta
|
||||
localizado en el <link linkend="constant.smarty.dir">SMARTY_DIR</link>.
|
||||
</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,33 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="variable.debugging.ctrl">
|
||||
<title>$debugging_ctrl</title>
|
||||
<para>
|
||||
Esto permite rutas alternativas para habilitar el debug.
|
||||
NONE no significa que m<>todos alternativos son permitidos.
|
||||
URL significa cuando la palabra SMARTY_DEBUG fue encontrada
|
||||
en el QUERY_STRING, que el debug est<73> habilitado para la
|
||||
llamada del script. Si $debugging es true, ese valor es
|
||||
ignorado.
|
||||
</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
|
||||
-->
|
||||
32
docs/es/programmers/api-variables/variable-debugging.xml
Normal file
32
docs/es/programmers/api-variables/variable-debugging.xml
Normal file
@@ -0,0 +1,32 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="variable.debugging">
|
||||
<title>$debugging</title>
|
||||
<para>
|
||||
Este habilita el
|
||||
<link linkend="chapter.debugging.console">debugging console</link>.
|
||||
La consola es una ventana de javascript que informa a usted
|
||||
sobre los archivos del template incluidos y las variables
|
||||
destinadas a la pagina del template actual.
|
||||
</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,33 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="variable.default.modifiers">
|
||||
<title>$default_modifiers</title>
|
||||
<para>
|
||||
Este es un arreglo de modificadores implicitamente aplicados para cada
|
||||
variable en el template. Por Ejemplo, cada variable HTML-escape por
|
||||
default, usa el arreglo('escape:"htmlall"'); Para hacer que las variables
|
||||
excenten los modificadores por default, pase el modificador especial
|
||||
"smarty" con un valor de par<61>metro "nodefaults" modificando esto, tal
|
||||
como {$var|smarty:nodefaults}.
|
||||
</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,33 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="variable.default.resource.type">
|
||||
<title>$default_resource_type</title>
|
||||
<para>
|
||||
Este anuncia a Smarty el tipo de recurso a usar implicitamente.
|
||||
El valor por default es 'file', significa que
|
||||
$smarty->display('index.tpl'); y
|
||||
$smarty->display('file:index.tpl'); son identicos en el significado.
|
||||
Para mas detalles vea el capitulo
|
||||
<link linkend="template.resources">resource</link>.
|
||||
</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,29 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="variable.default.template.handler.func">
|
||||
<title>$default_template_handler_func</title>
|
||||
<para>
|
||||
Esta funci<63>n es llamada cuando un template no puede ser obtenido
|
||||
desde su recurso.
|
||||
</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,31 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="variable.error.reporting">
|
||||
<title>$error_reporting</title>
|
||||
<para>
|
||||
Cuando este valor es asignado a non-null-value este valor es
|
||||
usado como error_reporting-level dentro de display() y fetch().
|
||||
Cuando debugging es habilitado este valor es ignorado y el
|
||||
error-level no es tocado.
|
||||
</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
|
||||
-->
|
||||
32
docs/es/programmers/api-variables/variable-force-compile.xml
Normal file
32
docs/es/programmers/api-variables/variable-force-compile.xml
Normal file
@@ -0,0 +1,32 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="variable.force.compile">
|
||||
<title>$force_compile</title>
|
||||
<para>
|
||||
Este forza al Smarty a (re)compilar templates en cada llamada.
|
||||
Esta configuraci<63>n sobrescribe $compile_check. Por default este
|
||||
es desabilitado. Es <20>til para el desarrollo y debug. Nunca debe ser
|
||||
usado en ambiente de producci<63>n. Si el cache esta habilitado, los
|
||||
archivo(s) de cache seran regenerados todo el tiempo.
|
||||
</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,29 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="variable.left.delimiter">
|
||||
<title>$left_delimiter</title>
|
||||
<para>
|
||||
Este es el delimitador izquierdo usado por el lenguaje de template.
|
||||
El default es "{".
|
||||
</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
|
||||
-->
|
||||
48
docs/es/programmers/api-variables/variable-php-handling.xml
Normal file
48
docs/es/programmers/api-variables/variable-php-handling.xml
Normal file
@@ -0,0 +1,48 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="variable.php.handling">
|
||||
<title>$php_handling</title>
|
||||
<para>
|
||||
Este informa al Smarty como manipular c<>digos PHP contenidos en los
|
||||
templates. Hay cuatro posibles configuraciones, siendo el default
|
||||
SMARTY_PHP_PASSTHRU. Observe que esto NO afectara los c<>digos php
|
||||
dentro de las etiquetas
|
||||
<link linkend="language.function.php">{php}{/php}</link> en el template.
|
||||
</para>
|
||||
<itemizedlist>
|
||||
<listitem><para>SMARTY_PHP_PASSTHRU - Smarty echos tags as-is.</para></listitem>
|
||||
<listitem><para>SMARTY_PHP_QUOTE - Smarty abre comillas a las etiquetas
|
||||
de entidades html.</para></listitem>
|
||||
<listitem><para>SMARTY_PHP_REMOVE - Smarty borra las etiquetas del
|
||||
template.</para></listitem>
|
||||
<listitem><para>SMARTY_PHP_ALLOW - Smarty ejecuta las etiquetas como
|
||||
c<>digo PHP.</para></listitem>
|
||||
</itemizedlist>
|
||||
<note>
|
||||
<para>
|
||||
Incrustar codigo PHP dentro del template es sumamente desalentador.
|
||||
Use <link linkend="language.custom.functions">custom functions</link>
|
||||
o <link linkend="language.modifiers">modifiers</link> en vez de eso.
|
||||
</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
|
||||
-->
|
||||
40
docs/es/programmers/api-variables/variable-plugins-dir.xml
Normal file
40
docs/es/programmers/api-variables/variable-plugins-dir.xml
Normal file
@@ -0,0 +1,40 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="variable.plugins.dir">
|
||||
<title>$plugins_dir</title>
|
||||
<para>
|
||||
Este es el directorio donde Smarty procurara ir a buscar los plugins
|
||||
que sean necesarios. El default es "plugins" bajo el SMARTY_DIR.
|
||||
Si usted proporciona un path relativo, Smarty procurara ir primero
|
||||
bajo el SMARTY_DIR, Entonces relativo para el cwd(current working
|
||||
directory), Entonces relativo para cada entrada de su PHP include path.
|
||||
</para>
|
||||
<note>
|
||||
<title>Nota T<>cnica</title>
|
||||
<para>
|
||||
Para un mejor funcionamiento, no configure su plugins_dir para que
|
||||
use el include path PHP. Use un path absoluto, o un path relativo
|
||||
para SMARTY_DIR o el cwd (current working directory).
|
||||
</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,35 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="variable.request.use.auto.globals">
|
||||
<title>$request_use_auto_globals</title>
|
||||
<para>
|
||||
Especifica si el Smarty debe usar variables globales del php
|
||||
$HTTP_*_VARS[] ($request_use_auto_globals=false valor por default)
|
||||
o $_*[] ($request_use_auto_globals=true). Esto afecta a los templates
|
||||
que hacen uso de {$smarty.request.*}, {$smarty.get.*} etc. .
|
||||
Atenci<63>n: Si usted asigna $request_use_auto_globals a true,
|
||||
<link linkend="variable.request.vars.order">variable.request.vars.order
|
||||
</link> no tendran efecto los valores de configuracion de php
|
||||
<literal>gpc_order</literal> sera usados.
|
||||
</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,29 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="variable.request.vars.order">
|
||||
<title>$request_vars_order</title>
|
||||
<para>
|
||||
El orden en el cual las variables requeridas seran registradas,
|
||||
similar al variables_order en el php.ini
|
||||
</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,29 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="variable.right.delimiter">
|
||||
<title>$right_delimiter</title>
|
||||
<para>
|
||||
Este es el delimitador derecho usado por el lenguaje de template.
|
||||
El default es "}".
|
||||
</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
|
||||
-->
|
||||
30
docs/es/programmers/api-variables/variable-secure-dir.xml
Normal file
30
docs/es/programmers/api-variables/variable-secure-dir.xml
Normal file
@@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="variable.secure.dir">
|
||||
<title>$secure_dir</title>
|
||||
<para>
|
||||
Este es un arreglo de todos los directorios locales que son
|
||||
considerados seguros. {include} y {fetch} usan estos (directorios)
|
||||
cuando security est<73> habilitada.
|
||||
</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,43 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="variable.security.settings">
|
||||
<title>$security_settings</title>
|
||||
<para>
|
||||
Estas son usadas para cancelar o especificar configuraciones de
|
||||
seguridad cuando security esta habilitado. Estas son las posibles
|
||||
configuraciones.
|
||||
</para>
|
||||
<itemizedlist>
|
||||
<listitem><para>PHP_HANDLING - true/false. la configuracion de
|
||||
$php_handling no es checada por security.</para></listitem>
|
||||
<listitem><para>IF_FUNCS - Este es un arreglo de nombres de funciones
|
||||
PHP permitidas en los bloques IF.</para></listitem>
|
||||
<listitem><para>INCLUDE_ANY - true/false. Si es asignado true, algun
|
||||
template puede ser incluido para un archivo de sistema, a pesar de toda
|
||||
la lista de $secure_dir.</para></listitem>
|
||||
<listitem><para>PHP_TAGS - true/false. Si es asignado true, las
|
||||
etiquetas {php}{/php} son permitidas en los templates.</para></listitem>
|
||||
<listitem><para>MODIFIER_FUNCS - Este es un arreglo de nombres de
|
||||
funciones PHP permitidas usadas como modificadores de variables.</para></listitem>
|
||||
</itemizedlist>
|
||||
</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
|
||||
-->
|
||||
47
docs/es/programmers/api-variables/variable-security.xml
Normal file
47
docs/es/programmers/api-variables/variable-security.xml
Normal file
@@ -0,0 +1,47 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="variable.security">
|
||||
<title>$security</title>
|
||||
<para>
|
||||
$security true/false, el default es false. Security es bueno
|
||||
para situaciones cuando usted tiene partes inconfiables editando
|
||||
el template (via ftp por ejemplo) y usetd quiere reducir los
|
||||
riesgos de comportamiento de seguridad del sistema a trav<61>s del
|
||||
lenguaje del template. Al habilitar la seguridad forza las siguientes
|
||||
reglas del lenguaje del template, a menos que especifique control con
|
||||
$security_settings:
|
||||
</para>
|
||||
<itemizedlist>
|
||||
<listitem><para>Si $php_handling est<73> asignado a SMARTY_PHP_ALLOW,
|
||||
este es implicitamente cambiado a SMARTY_PHP_PASSTHRU</para></listitem>
|
||||
<listitem><para>Las funciones PHP no son permitidas en sentencias IF,
|
||||
excepto quellas que esten especificadas en $security_settings</para></listitem>
|
||||
<listitem><para>Los templates solo pueden ser incluidos en el
|
||||
directorio listado en $secure_dir array</para></listitem>
|
||||
<listitem><para>Los archivos locales solamente pueden ser traidos del
|
||||
directorio listado en $secure_dir usando el arreglo {fetch}</para></listitem>
|
||||
<listitem><para>Estas etiquetas {php}{/php} no son permitidas</para></listitem>
|
||||
<listitem><para>Las funciones PHP no son permitidas como modificadores,
|
||||
excepto si estan especificados en el $security_settings</para></listitem>
|
||||
</itemizedlist>
|
||||
</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
|
||||
-->
|
||||
39
docs/es/programmers/api-variables/variable-template-dir.xml
Normal file
39
docs/es/programmers/api-variables/variable-template-dir.xml
Normal file
@@ -0,0 +1,39 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="variable.template.dir">
|
||||
<title>$template_dir</title>
|
||||
<para>
|
||||
Este es el nombre por default del directorio del template. Si
|
||||
usted no proporciona un tipo de recurso que incluya archivos,
|
||||
entonces estos se encontraran aqu<71>. Por default "./templates",
|
||||
esto significa que lo buscara en el directorio del templates
|
||||
en el mismo directorio que esta ejecutando el script PHP.
|
||||
</para>
|
||||
<note>
|
||||
<title>Nota T<>cnica</title>
|
||||
<para>
|
||||
No es recomendado colocar este directorio bajo el directorio
|
||||
document root de su servidor web.
|
||||
</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
|
||||
-->
|
||||
32
docs/es/programmers/api-variables/variable-trusted-dir.xml
Normal file
32
docs/es/programmers/api-variables/variable-trusted-dir.xml
Normal file
@@ -0,0 +1,32 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="variable.trusted.dir">
|
||||
<title>$trusted_dir</title>
|
||||
<para>
|
||||
$trusted_dir solamente es usado cuando $security est<73> habilitado.
|
||||
Este es un arreglo de todos los directorios que son considerados
|
||||
confiables. Los directorios confiables son de donde usted extraera
|
||||
sus script PHP que son ejecutados directamente desde el template con
|
||||
<link linkend="language.function.include.php">{include_php}</link>.
|
||||
</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
|
||||
-->
|
||||
36
docs/es/programmers/api-variables/variable-use-sub-dirs.xml
Normal file
36
docs/es/programmers/api-variables/variable-use-sub-dirs.xml
Normal file
@@ -0,0 +1,36 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="variable.use.sub.dirs">
|
||||
<title>$use_sub_dirs</title>
|
||||
<para>
|
||||
Configure este a false si su ambiente de PHP no permite la craci<63>n
|
||||
de subdirectorios para Smarty. Los subdiretorios son mas eficientes,
|
||||
Entonces aprovechelo si puede.
|
||||
</para>
|
||||
<note>
|
||||
<title>Nota T<>cnica</title>
|
||||
<para>
|
||||
Desde Smarty-2.6.2 <varname>use_sub_dirs</varname> esta por default en false.
|
||||
</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
|
||||
-->
|
||||
51
docs/es/programmers/caching.xml
Normal file
51
docs/es/programmers/caching.xml
Normal file
@@ -0,0 +1,51 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<chapter id="caching">
|
||||
<title>Cache</title>
|
||||
<para>
|
||||
Caching es usado para aumentar la velocidad de llamada de
|
||||
<link linkend="api.display">display()</link> o
|
||||
<link linkend="api.fetch">fetch()</link> salvando esto en un
|
||||
archivo de salida. Si hay una versi<73>n de cache disponible
|
||||
para la llamada, este es mostrado en vez de regresar la salida
|
||||
de datos. Caching puede hacer cosas tremendamente r<>pidas,
|
||||
especialmente templates con largo tiempo de computo.
|
||||
Desde la salida de datos de display() o fetch() est<73> en
|
||||
cache, un archivo de cache podr<64>a ser compuesto por diversos
|
||||
archivos de templates, archivos de configuraci<63>n, etc.
|
||||
</para>
|
||||
<para>
|
||||
Dado que sus templates son din<69>micos, es importante tener cuidado
|
||||
de como usa la cache y por cuanto tiempo. Por ejemplo, si usted esta
|
||||
mostrando la pagina principal de su web site y esta no tiene cambios
|
||||
muy frecuentes en su contenido, esta puede funcionar bien en la cache
|
||||
por una hora o mas. por otro lado, si usted esta mostrando una pagina
|
||||
con un mapa de tiempo que contenga nueva informaci<63>n por minuto, no
|
||||
tiene sentido hacer cache nuestra p<>gina.
|
||||
</para>
|
||||
&programmers.caching.caching-setting-up;
|
||||
&programmers.caching.caching-multiple-caches;
|
||||
&programmers.caching.caching-groups;
|
||||
|
||||
&programmers.caching.caching-cacheable;
|
||||
</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
|
||||
-->
|
||||
143
docs/es/programmers/caching/caching-cacheable.xml
Normal file
143
docs/es/programmers/caching/caching-cacheable.xml
Normal file
@@ -0,0 +1,143 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="caching.cacheable">
|
||||
<title>Controlando salida de Cacheabilidad de plugins</title>
|
||||
<para>
|
||||
Desde Smarty-2.6.0 los caches de plugins pueden ser declarados
|
||||
o registrados. El tercer par<61>metro para register_block,
|
||||
register_compiler_function es register_function es llamado
|
||||
<parameter>$cacheable</parameter> y el default es true que es
|
||||
tambi<62>n el comportamiento de plugins en la versiones anteriores
|
||||
a Smarty 2.6.0.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Cuando registre un plugin con $cacheable=false el plugin es llamado
|
||||
todo el tiempo en la pagina que est<73> siendo mostrada, aun si la
|
||||
pagina viene desde el cache.
|
||||
La funci<63>n de plugin tiene un comportamiento parecido al de
|
||||
la funci<63>n <link linkend="plugins.inserts">insert</link>.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
En contraste con <link linkend="language.function.insert">{insert}</link>
|
||||
el atributo para el plugin no est<73> en cache por default. Ellos pueden ser
|
||||
declarados para ser cacheados con el cuarto par<61>metro
|
||||
<parameter>$cache_attrs</parameter>. <parameter>$cache_attrs</parameter>
|
||||
es un arreglo de nombres de atributos que deben ser cacheados, entonces la
|
||||
funci<63>n de plugin pega el valor como si fuera el tiempo en que la pagina
|
||||
fue escrita para el cache todo el tiempo este es traido desde el cache.
|
||||
</para>
|
||||
|
||||
<example>
|
||||
<title>Previniendo que una sa<73>da de plugin de ser cacheada</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
require('Smarty.class.php');
|
||||
$smarty = new Smarty;
|
||||
$smarty->caching = true;
|
||||
|
||||
function remaining_seconds($params, &$smarty) {
|
||||
$remain = $params['endtime'] - time();
|
||||
if ($remain >=0)
|
||||
return $remain . " second(s)";
|
||||
else
|
||||
return "done";
|
||||
}
|
||||
|
||||
$smarty->register_function('remaining', 'remaining_seconds', false, array('endtime'));
|
||||
|
||||
if (!$smarty->is_cached('index.tpl')) {
|
||||
// fetch $obj from db and assign...
|
||||
$smarty->assign_by_ref('obj', $obj);
|
||||
}
|
||||
|
||||
$smarty->display('index.tpl');
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Donde index.tpl es:
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
Time Remaining: {remain endtime=$obj->endtime}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
El n<>mero en segundos hasta el endtime del $obj este sufre cambios
|
||||
en cada display de la pagina, aun si la pagina esta en cache. Desde
|
||||
que el atributo endtime sea cacheado el objeto solamente tiene que
|
||||
ser jalado de la base de datos cuando la pagina esta escrita en la
|
||||
cache mas no en requisiciones de la pagina.
|
||||
</para>
|
||||
</example>
|
||||
|
||||
<example>
|
||||
<title>Previniendo una pasada entera del template para el cache</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
index.php:
|
||||
|
||||
<?php
|
||||
require('Smarty.class.php');
|
||||
$smarty = new Smarty;
|
||||
$smarty->caching = true;
|
||||
|
||||
function smarty_block_dynamic($param, $content, &$smarty) {
|
||||
return $content;
|
||||
}
|
||||
$smarty->register_block('dynamic', 'smarty_block_dynamic', false);
|
||||
|
||||
$smarty->display('index.tpl');
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Donde index.tpl es:
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
Page created: {"0"|date_format:"%D %H:%M:%S"}
|
||||
|
||||
{dynamic}
|
||||
|
||||
Now is: {"0"|date_format:"%D %H:%M:%S"}
|
||||
|
||||
... do other stuff ...
|
||||
|
||||
{/dynamic}
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
<para>
|
||||
Cuando recarga la pagina usted notara que ambas fechas son diferentes.
|
||||
Una es "dinamica" y la otra es "est<73>tica". Usted puede hacer todo entre
|
||||
las etiquetas {dynamic}...{/dynamic} y tener la certeza de que no sera
|
||||
cacheado como el resto de la pagina.
|
||||
</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
|
||||
-->
|
||||
86
docs/es/programmers/caching/caching-groups.xml
Normal file
86
docs/es/programmers/caching/caching-groups.xml
Normal file
@@ -0,0 +1,86 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="caching.groups">
|
||||
<title>Cache Groups</title>
|
||||
<para>
|
||||
Usted puede hacer agrupamientos mas elaborados configurando grupos de
|
||||
cache_id. Esto se logra con la separaci<63>n de cada sub-grupo con una
|
||||
barra vertical "|" en el valor del cache_id. Usted puede tener tantos
|
||||
sub-grupos como guste.
|
||||
</para>
|
||||
<para>
|
||||
Usted puede pensar que los grupos de cache son parecidos a un
|
||||
directorio para organizar. por ejemplo, un grupo de cache con
|
||||
"a|b|b" podria pensarse como la estructura del directorio "a/b/c/".
|
||||
clear_cache(null,"a|b|c") esto seria para quitar los archivos
|
||||
"/a/b/c/*". clear_cache(null,"a|b") esto seria para quitar los
|
||||
archivos "/a/b/*". Si usted espicifica el compile_id como
|
||||
clear_cache(null,"a|b","foo") este tratara de agregarlo al grupo
|
||||
de cache "/a/b/c/foo/". Si usted especifica el nombre del template
|
||||
tal como clear_cache("foo.tpl","a|b|c") entonces el smarty intentara
|
||||
borrar "/a/b/c/foo.tpl".
|
||||
Usted no puede borrar un nombre de template especifico bajo multiples
|
||||
grupos de cache como "/a/b/*/foo.tpl", el grupo de cache trabaja solo
|
||||
de izquierda a derecha. Usted puede necesitar para su grupos de
|
||||
templates un unico grupo de cache jerarquico para poder limpiarlos
|
||||
como grupos.
|
||||
</para>
|
||||
<para>
|
||||
El agupamiento de cache no debe ser confundido con su directorio
|
||||
jerarquico del template, El agrupamiento de cache no tiene ninguna
|
||||
ciencia de como sus templates son estructurados.
|
||||
Por ejemplo, si usted tiene una estructura display('themes/blue/index.tpl'),
|
||||
usted no puede limpiar el cache para todo bajo el diretorio "themes/blue".
|
||||
Si usted quiere hacer esto, usted debe agruparlos en el cache_id, como
|
||||
display('themes/blue/index.tpl','themes|blue'); Entonces usted puede
|
||||
limpiar los caches para el tema azul con clear_cache(null,'themes|blue');
|
||||
</para>
|
||||
<example>
|
||||
<title>Grupos de cache_id</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
require('Smarty.class.php');
|
||||
$smarty = new Smarty;
|
||||
|
||||
$smarty->caching = true;
|
||||
|
||||
// clear all caches with "sports|basketball" as the first two cache_id groups
|
||||
$smarty->clear_cache(null,"sports|basketball");
|
||||
|
||||
// clear all caches with "sports" as the first cache_id group. This would
|
||||
// include "sports|basketball", or "sports|(anything)|(anything)|(anything)|..."
|
||||
$smarty->clear_cache(null,"sports");
|
||||
|
||||
// clear the foo.tpl cache file with "sports|basketball" as the cache_id
|
||||
$smarty->clear_cache("foo.tpl","sports|basketball");
|
||||
|
||||
|
||||
$smarty->display('index.tpl',"sports|basketball");
|
||||
?>
|
||||
]]>
|
||||
</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
|
||||
-->
|
||||
129
docs/es/programmers/caching/caching-multiple-caches.xml
Normal file
129
docs/es/programmers/caching/caching-multiple-caches.xml
Normal file
@@ -0,0 +1,129 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="caching.multiple.caches">
|
||||
<title>Multiples caches por pagina</title>
|
||||
<para>
|
||||
Usted puede tener multiples archivos de cache para una simples llamada
|
||||
de display() o fetch(). Vamos a decir que una llamada a
|
||||
display('index.tpl') debe tener varios contenidos de salida diferentes
|
||||
dependiendo de alguna condici<63>n, y usted quiere separar los caches para
|
||||
cada una. Usted puede hacer esto pasando un cache_id como un segundo
|
||||
par<61>metro en la llamada de la funci<63>n.
|
||||
</para>
|
||||
<example>
|
||||
<title>Pasando un cache_id para display()</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
require('Smarty.class.php');
|
||||
$smarty = new Smarty;
|
||||
|
||||
$smarty->caching = true;
|
||||
|
||||
$my_cache_id = $_GET['article_id'];
|
||||
|
||||
$smarty->display('index.tpl',$my_cache_id);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Arriba, nosotros pasamos la variable $my_cache_id a display() con
|
||||
el cache_id. Para cada valor unico de $my_cache_id, un cache por
|
||||
separado sera generado para cada index.tpl. En este ejemplo,
|
||||
"article_id" fue pasado en URL y es usado como el cache_id.
|
||||
</para>
|
||||
<note>
|
||||
<title>Nota T<>cnica</title>
|
||||
<para>
|
||||
Tenga mucho cuidado cuando pase valores del cliente (web browser)
|
||||
dentro de Smarty (o alguna aplicaci<63>n PHP). Aunque el ejemplo de
|
||||
arriba usar el article_id desde una URL parece facil, esto podr<64>a
|
||||
tener fatales consecuencias. El cache_id es usado para crear un
|
||||
directorio en el sistema de archivos, entonces si el usuario decide
|
||||
pasar un valor extremadamente largo para article_id, o escribir un
|
||||
script que envia article_ids aleatorios en un paso r<>pido, esto
|
||||
posiblemente podr<64>a causar problemas a nivel del servidor. Tenga la
|
||||
certeza de limpiar alg<6C>n dato pasado antes de usarlo. En este ejemplo,
|
||||
tal vez usted sabia que el article_id tiene un largo de 10 caracteres
|
||||
este es constituido solamente de alfanum<75>ricos, y debe ser un article_id
|
||||
valido en la base de datos. Verifique esto!
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
Asegurarse de pasar el mismo cache_id como el segundo par<61>metro
|
||||
para <link linkend="api.is.cached">is_cached()</link> y
|
||||
<link linkend="api.clear.cache">clear_cache()</link>.
|
||||
</para>
|
||||
<example>
|
||||
<title>Pasando un cache_id para is_cached()</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
require('Smarty.class.php');
|
||||
$smarty = new Smarty;
|
||||
|
||||
$smarty->caching = true;
|
||||
|
||||
$my_cache_id = $_GET['article_id'];
|
||||
|
||||
if(!$smarty->is_cached('index.tpl',$my_cache_id)) {
|
||||
// No cache available, do variable assignments here.
|
||||
$contents = get_database_contents();
|
||||
$smarty->assign($contents);
|
||||
}
|
||||
|
||||
$smarty->display('index.tpl',$my_cache_id);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Usted puede limpar todos los caches para un cache_id en particular
|
||||
pasando el primer par<61>metro null a clear_cache().
|
||||
</para>
|
||||
<example>
|
||||
<title> Limpando todos los caches para un cache_id en particular</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
require('Smarty.class.php');
|
||||
$smarty = new Smarty;
|
||||
|
||||
$smarty->caching = true;
|
||||
|
||||
// clear all caches with "sports" as the cache_id
|
||||
$smarty->clear_cache(null,"sports");
|
||||
|
||||
$smarty->display('index.tpl',"sports");
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
De esta manera, usted puede "agrupar" sus caches conjuntamente dandoles
|
||||
el mismo cache_id.
|
||||
</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
|
||||
-->
|
||||
199
docs/es/programmers/caching/caching-setting-up.xml
Normal file
199
docs/es/programmers/caching/caching-setting-up.xml
Normal file
@@ -0,0 +1,199 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="caching.setting.up">
|
||||
<title>Configurando el Cache</title>
|
||||
<para>
|
||||
Lo primero que se tiene que hacer es habilitar el cache. esto es configurar
|
||||
<link linkend="variable.caching">$caching</link> = true (o 1.)
|
||||
</para>
|
||||
<example>
|
||||
<title>Habilitando Cache</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
require('Smarty.class.php');
|
||||
$smarty = new Smarty;
|
||||
|
||||
$smarty->caching = true;
|
||||
|
||||
$smarty->display('index.tpl');
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Con el caching habilitado, la llamada a la funci<63>n
|
||||
display('index.tpl') traera el template como siempre,
|
||||
pero tambi<62>n salvara una copia en el archivo de salida
|
||||
(una copia de cache) en el
|
||||
<link linkend="variable.cache.dir">$cache_dir</link>.
|
||||
En la proxima llamada de display('index.tpl'), la copia
|
||||
en cache sera usada en vez de traer nuevamente el template.
|
||||
</para>
|
||||
<note>
|
||||
<title>Nota T<>cnica</title>
|
||||
<para>
|
||||
Los archivos en el $cache_dir son nombrados similarmente al
|
||||
nombre del archivo de template.
|
||||
Aunque ellos tengan una extensi<73>n ".php", ellos no son realmente
|
||||
scripts ejecutables de php. No edite estos archivos!
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
Cada pagina en cache tiene un periodo de tiempo limitado determinado por
|
||||
<link linkend="variable.cache.lifetime">$cache_lifetime</link>.
|
||||
El default del valor es 3600 segundos, o 1 hora. Despu<70>s de este tiempo
|
||||
expira, el cache es regenerado. Es posible dar tiempos individuales para
|
||||
caches con su propio tiempo de expiraci<63>n para configuraci<63>n $caching = 2.
|
||||
Vea la documentaci<63>n en
|
||||
<link linkend="variable.cache.lifetime">$cache_lifetime</link>
|
||||
para mas detalles.
|
||||
</para>
|
||||
<example>
|
||||
<title>Configurando cache_lifetime por cache</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
require('Smarty.class.php');
|
||||
$smarty = new Smarty;
|
||||
|
||||
$smarty->caching = 2; // lifetime is per cache
|
||||
|
||||
// set the cache_lifetime for index.tpl to 5 minutes
|
||||
$smarty->cache_lifetime = 300;
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
// set the cache_lifetime for home.tpl to 1 hour
|
||||
$smarty->cache_lifetime = 3600;
|
||||
$smarty->display('home.tpl');
|
||||
|
||||
// NOTE: the following $cache_lifetime setting will not work when $caching = 2.
|
||||
// The cache lifetime for home.tpl has already been set
|
||||
// to 1 hour, and will no longer respect the value of $cache_lifetime.
|
||||
// The home.tpl cache will still expire after 1 hour.
|
||||
$smarty->cache_lifetime = 30; // 30 seconds
|
||||
$smarty->display('home.tpl');
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Si <link linkend="variable.compile.check">$compile_check</link> est<73>
|
||||
habilitado, cada archivo de template y archivo de configuraci<63>n que
|
||||
est<73> involucrado con el archivo en cache es checado por modificadores.
|
||||
Si alguno de estos archivos fue modificado desde que el ultimo cache
|
||||
fue generado, el cache es regenerado inmediatamente. Esto es una forma
|
||||
de optimizar ligeramente el rendimiento de las cabeceras, dejar
|
||||
$compile_check determinado false.
|
||||
</para>
|
||||
<example>
|
||||
<title>Habilitando $compile_check</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
require('Smarty.class.php');
|
||||
$smarty = new Smarty;
|
||||
|
||||
$smarty->caching = true;
|
||||
$smarty->compile_check = true;
|
||||
|
||||
$smarty->display('index.tpl');
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Si <link linkend="variable.force.compile">$force_compile</link> est<73>
|
||||
habilitado, los archivos de cache siempre seran regenerados.
|
||||
Esto definitivamente desactiva el caching. $force_compile generalmente
|
||||
es usado para propositos de debug solamente, una forma mas eficiente
|
||||
de desactivar el caching es asignando
|
||||
<link linkend="variable.caching">$caching</link> = false (<28> 0.)
|
||||
</para>
|
||||
<para>
|
||||
La funci<63>n <link linkend="api.is.cached">is_cached()</link> puede ser
|
||||
usada para testar si un template tiene un cache valido o no. Si usted
|
||||
tiene un template con cache que requiera alguna cosa como un retorno
|
||||
de base de datos, usted puede usar esto para saltar este proceso.
|
||||
</para>
|
||||
<example>
|
||||
<title>Usando is_cached()</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
require('Smarty.class.php');
|
||||
$smarty = new Smarty;
|
||||
|
||||
$smarty->caching = true;
|
||||
|
||||
if(!$smarty->is_cached('index.tpl')) {
|
||||
// No cache available, do variable assignments here.
|
||||
$contents = get_database_contents();
|
||||
$smarty->assign($contents);
|
||||
}
|
||||
|
||||
$smarty->display('index.tpl');
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Usted puede guardar partes de su pagina din<69>mica con la funci<63>n
|
||||
de template <link linkend="language.function.insert">insert</link>.
|
||||
Vamos a decir que su pagina entera puede tener cache excepto para un
|
||||
banner que es mostrado abajo del lado derecho de su pagina. Usando
|
||||
la funci<63>n insert para el banner, usted puede guardar ese elemento
|
||||
din<69>mico dentro de un contenido de cache. Vea la documentaci<63>n en
|
||||
<link linkend="language.function.insert">insert</link> para detalles
|
||||
y ejemplos.
|
||||
</para>
|
||||
<para>
|
||||
Usted puede limpiar todos los archivos de cache con la funci<63>n
|
||||
<link linkend="api.clear.all.cache">clear_all_cache()</link>,
|
||||
los archivos de cache individuales (o grupos) con la funci<63>n
|
||||
<link linkend="api.clear.cache">clear_cache()</link>.
|
||||
</para>
|
||||
<example>
|
||||
<title>Limpiando el cache</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
require('Smarty.class.php');
|
||||
$smarty = new Smarty;
|
||||
|
||||
$smarty->caching = true;
|
||||
|
||||
// clear out all cache files
|
||||
$smarty->clear_all_cache();
|
||||
|
||||
// clear only cache for index.tpl
|
||||
$smarty->clear_cache('index.tpl');
|
||||
|
||||
$smarty->display('index.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
|
||||
-->
|
||||
69
docs/es/programmers/plugins.xml
Normal file
69
docs/es/programmers/plugins.xml
Normal file
@@ -0,0 +1,69 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<chapter id="plugins">
|
||||
<title>Extendiendo Smarty con plugins</title>
|
||||
<para>
|
||||
La version 2.0 introduce la arquitectura de plugin que es usada para
|
||||
casi todas las funcionalidades adaptables del Smarty. Esto incluye:
|
||||
<itemizedlist spacing="compact">
|
||||
<listitem><simpara>funciones</simpara></listitem>
|
||||
<listitem><simpara>modificadores</simpara></listitem>
|
||||
<listitem><simpara>funciones de bloque</simpara></listitem>
|
||||
<listitem><simpara>funciones de compilaci<63>n</simpara></listitem>
|
||||
<listitem><simpara>prefiltros</simpara></listitem>
|
||||
<listitem><simpara>postfiltros</simpara></listitem>
|
||||
<listitem><simpara>filtros de salida</simpara></listitem>
|
||||
<listitem><simpara>recursos(fuentes)</simpara></listitem>
|
||||
<listitem><simpara>inserts</simpara></listitem>
|
||||
</itemizedlist>
|
||||
Con la excepci<63>n de recursos, la compatibildad con la forma antigua
|
||||
de funciones de manipulaci<63>n de registro via register_* API es
|
||||
conservada. Si usted no uso el API en lugar de eso modifico las
|
||||
variables de clase <literal>$custom_funcs</literal>,
|
||||
<literal>$custom_mods</literal>, y otras directamente, entonces usted
|
||||
va a necesitar ajustar sus scripts para cualquiera que use el API o
|
||||
convertir sus funciones habituales en plugins.
|
||||
</para>
|
||||
|
||||
&programmers.plugins.plugins-howto;
|
||||
|
||||
&programmers.plugins.plugins-naming-conventions;
|
||||
|
||||
&programmers.plugins.plugins-writing;
|
||||
|
||||
&programmers.plugins.plugins-functions;
|
||||
|
||||
&programmers.plugins.plugins-modifiers;
|
||||
|
||||
&programmers.plugins.plugins-block-functions;
|
||||
|
||||
&programmers.plugins.plugins-compiler-functions;
|
||||
|
||||
&programmers.plugins.plugins-prefilters-postfilters;
|
||||
|
||||
&programmers.plugins.plugins-outputfilters;
|
||||
|
||||
&programmers.plugins.plugins-resources;
|
||||
|
||||
&programmers.plugins.plugins-inserts;
|
||||
</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
|
||||
-->
|
||||
119
docs/es/programmers/plugins/plugins-block-functions.xml
Normal file
119
docs/es/programmers/plugins/plugins-block-functions.xml
Normal file
@@ -0,0 +1,119 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="plugins.block.functions"><title>Block Functions</title>
|
||||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
<funcdef>void <function>smarty_block_<replaceable>name</replaceable></function></funcdef>
|
||||
<paramdef>array <parameter>$params</parameter></paramdef>
|
||||
<paramdef>mixed <parameter>$content</parameter></paramdef>
|
||||
<paramdef>object <parameter>&$smarty</parameter></paramdef>
|
||||
<paramdef>boolean <parameter>&$repeat</parameter></paramdef>
|
||||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
<para>
|
||||
Las funciones de bloque son funciones de forma: {func} .. {/func}.
|
||||
En otras palabras, estas encapsulan un bloque del template y operan
|
||||
el contenido de este bloque. Las funciones de bloque toman precedencia
|
||||
sobre las funciones habituales con el mismo nombre, es decir, usted no
|
||||
puede tener ambas, las funciones habituales {func} y las funciones de
|
||||
bloque {func} .. {/func}.
|
||||
</para>
|
||||
<para>
|
||||
Por default la implementaci<63>n de su funci<63>n es llamada dos
|
||||
veces por el Smarty: una vez por la etiqueta de apertura, y
|
||||
la otra por la etiqueta de cierre
|
||||
(vea <literal>&$repeat</literal> abajo para ver como hacer
|
||||
cambios a esto).
|
||||
</para>
|
||||
<para>
|
||||
Solo la etiqueta de apertura de la funci<63>n de bloque puede tener
|
||||
atributos. Todos los atributos pasados a las funciones de template
|
||||
estan contenidos en <parameter>$params</parameter> como un arreglo
|
||||
asociativo. Usted puede accesar a cualquiera de estos valores
|
||||
directamente, e.g. <varname>$params['start']</varname>.
|
||||
Los atributos de la etiqueta de apertura son tambi<62>n son accesibles
|
||||
a su funci<63>n cuando se procesa la etiqueta de cierre.
|
||||
</para>
|
||||
<para>
|
||||
El valor de la variable <parameter>$content</parameter> depende de
|
||||
que si su funci<63>n es llamada por la etiqueta de cierre o de apertura.
|
||||
En caso de que la etiqueta sea de apertura, este ser<65>
|
||||
<literal>null</literal>, si la etiqueta es de cierre el valor ser<65>
|
||||
del contenido del bloque del template. Se debe observar que el bloque
|
||||
del template ya a sido procesado por el Smarty, asi todo lo que usted
|
||||
recibir<69> es la salida del template, no el template original.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
El par<61>metro <parameter>&$repeat</parameter> es pasado por
|
||||
referencia para la función de implementaci<63>n y proporciona
|
||||
la posibilidad de controlar cuantas veces ser<65> mostrado el bloque.
|
||||
Por default <parameter>$repeat</parameter> es <literal>true</literal>
|
||||
en la primera llamada de la block-function (etiqueta de apertura del
|
||||
bloque) y <literal>false</literal> en todas las llamadas subsecuentes
|
||||
a la funci<63>n de boque (etiqueta de cierre del boque). Cada vez que es
|
||||
implementada la funci<63>n retorna con el <parameter>&$repeat</parameter>
|
||||
siendo true, el contenido entre {func} .. {/func} es evaluado y es
|
||||
implementado a la funci<63>n es llamada nuevamente con el nuevo contenido
|
||||
del bloque en el par<61>metro <parameter>$content</parameter>.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Si usted tiene funciones de bloque anidadas, es posible descubrir
|
||||
cual es el padre de la funci<63>n de bloque accesando la variable
|
||||
<varname>$smarty->_tag_stack</varname>.
|
||||
Solo hacer un var_dump() sobre ella y la estrutura estara visible.
|
||||
</para>
|
||||
<para>
|
||||
Vea tambien:
|
||||
<link linkend="api.register.block">register_block()</link>,
|
||||
<link linkend="api.unregister.block">unregister_block()</link>.
|
||||
</para>
|
||||
<example>
|
||||
<title>Funci<EFBFBD>n de bloque</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
/*
|
||||
* Smarty plugin
|
||||
* -------------------------------------------------------------
|
||||
* File: block.translate.php
|
||||
* Type: block
|
||||
* Name: translate
|
||||
* Purpose: translate a block of text
|
||||
* -------------------------------------------------------------
|
||||
*/
|
||||
function smarty_block_translate($params, $content, &$smarty, &$repeat)
|
||||
{
|
||||
if (isset($content)) {
|
||||
$lang = $params['lang'];
|
||||
// do some intelligent translation thing here with $content
|
||||
return $translation;
|
||||
}
|
||||
}
|
||||
?>
|
||||
]]>
|
||||
</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
|
||||
-->
|
||||
91
docs/es/programmers/plugins/plugins-compiler-functions.xml
Normal file
91
docs/es/programmers/plugins/plugins-compiler-functions.xml
Normal file
@@ -0,0 +1,91 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="plugins.compiler.functions"><title>Funciones Compiladoras</title>
|
||||
<para>
|
||||
Las funciones compiladoras solo son llamadas durante la compilaci<63>n
|
||||
del template. Estas son <20>tiles para inyectar codigo PHP o contenido
|
||||
est<73>tico time-sensitive dentro del template. Si existen ambas, una
|
||||
funci<63>n compiladora y una funci<63>n habitual registrada bajo el mismo
|
||||
nombre, la funci<63>n compiladora tiene precedencia.
|
||||
</para>
|
||||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
<funcdef>mixed <function>smarty_compiler_<replaceable>name</replaceable></function></funcdef>
|
||||
<paramdef>string <parameter>$tag_arg</parameter></paramdef>
|
||||
<paramdef>object <parameter>&$smarty</parameter></paramdef>
|
||||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
<para>
|
||||
En las funciones compiladoras son pasados dos par<61>metros:
|
||||
la etiqueta string del argumento de la etiqueta - basicamente,
|
||||
todo a partir del nombre de la funci<63>n hasta el delimitador del
|
||||
cierre, y el objeto del Smarty. Es supuesto que retorna el codigo
|
||||
PHP para ser inyectado dentro del template compilado.
|
||||
</para>
|
||||
<para>
|
||||
Vea tambi<62>n
|
||||
<link linkend="api.register.compiler.function">register_compiler_function()</link>,
|
||||
<link linkend="api.unregister.compiler.function">unregister_compiler_function()</link>.
|
||||
</para>
|
||||
<example>
|
||||
<title>Funci<EFBFBD>n compiladora simple</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
/*
|
||||
* Smarty plugin
|
||||
* -------------------------------------------------------------
|
||||
* File: compiler.tplheader.php
|
||||
* Type: compiler
|
||||
* Name: tplheader
|
||||
* Purpose: Output header containing the source file name and
|
||||
* the time it was compiled.
|
||||
* -------------------------------------------------------------
|
||||
*/
|
||||
function smarty_compiler_tplheader($tag_arg, &$smarty)
|
||||
{
|
||||
return "\necho '" . $smarty->_current_file . " compiled at " . date('Y-m-d H:M'). "';";
|
||||
}
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Esta funci<63>n puede ser llamada en un template de la siguiente forma:
|
||||
</para>
|
||||
<programlisting>
|
||||
{* esta funci<63>n es ejecutada solamente en tiempo de compilaci<63>n *}
|
||||
{tplheader}
|
||||
</programlisting>
|
||||
<para>
|
||||
El codigo PHP resultante en el template compilado seria algo asi:
|
||||
</para>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
echo 'index.tpl compiled at 2002-02-20 20:02';
|
||||
?>
|
||||
]]>
|
||||
</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
|
||||
-->
|
||||
127
docs/es/programmers/plugins/plugins-functions.xml
Normal file
127
docs/es/programmers/plugins/plugins-functions.xml
Normal file
@@ -0,0 +1,127 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="plugins.functions"><title>Funciones de Template</title>
|
||||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
<funcdef>void <function>smarty_function_<replaceable>name</replaceable></function></funcdef>
|
||||
<paramdef>array <parameter>$params</parameter></paramdef>
|
||||
<paramdef>object <parameter>&$smarty</parameter></paramdef>
|
||||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
<para>
|
||||
Todos los atributos pasados para las funciones de template a partir
|
||||
del template estan contenidas en <parameter>$params</parameter> como
|
||||
un arreglo asociativo.
|
||||
</para>
|
||||
<para>
|
||||
La salida(valor de retorno) de la funci<63>n ser<65> substituida en
|
||||
el lugar de la etiqueta de la funci<63>n en el template (la funci<63>n
|
||||
<function>fetch</function>, por ejemplo).
|
||||
Alternativamente, la funci<63>n puede simplemente ejecutar alguna
|
||||
otra tarea sin tener alguna salida (la funci<63>n <function>assign</function>).
|
||||
</para>
|
||||
<para>
|
||||
Si la funci<63>n necesita pasar valores a algunas variables del template
|
||||
o utilizar alguna otra funcionalidad del Smarty, esta puede usar el
|
||||
objeto <parameter>$smarty</parameter> alimentandolo para hacer eso.
|
||||
</para>
|
||||
<para>
|
||||
Vea tambien:
|
||||
<link linkend="api.register.function">register_function()</link>,
|
||||
<link linkend="api.unregister.function">unregister_function()</link>.
|
||||
</para>
|
||||
<para>
|
||||
<example>
|
||||
<title>Funci<EFBFBD>n de plugin con salida</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
/*
|
||||
* Smarty plugin
|
||||
* -------------------------------------------------------------
|
||||
* File: function.eightball.php
|
||||
* Type: function
|
||||
* Name: eightball
|
||||
* Purpose: outputs a random magic answer
|
||||
* -------------------------------------------------------------
|
||||
*/
|
||||
function smarty_function_eightball($params, &$smarty)
|
||||
{
|
||||
$answers = array('Yes',
|
||||
'No',
|
||||
'No way',
|
||||
'Outlook not so good',
|
||||
'Ask again soon',
|
||||
'Maybe in your reality');
|
||||
|
||||
$result = array_rand($answers);
|
||||
return $answers[$result];
|
||||
}
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
<para>
|
||||
que puede ser usada en el template de la siguiente forma:
|
||||
</para>
|
||||
<programlisting>
|
||||
Question: Will we ever have time travel?
|
||||
Answer: {eightball}.
|
||||
</programlisting>
|
||||
<para>
|
||||
<example>
|
||||
<title>Funci<EFBFBD>n de plugin sin salida</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
/*
|
||||
* Smarty plugin
|
||||
* -------------------------------------------------------------
|
||||
* File: function.assign.php
|
||||
* Type: function
|
||||
* Name: assign
|
||||
* Purpose: assign a value to a template variable
|
||||
* -------------------------------------------------------------
|
||||
*/
|
||||
function smarty_function_assign($params, &$smarty)
|
||||
{
|
||||
if (empty($params['var'])) {
|
||||
$smarty->trigger_error("assign: missing 'var' parameter");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!in_array('value', array_keys($params))) {
|
||||
$smarty->trigger_error("assign: missing 'value' parameter");
|
||||
return;
|
||||
}
|
||||
|
||||
$smarty->assign($params['var'], $params['value']);
|
||||
}
|
||||
?>
|
||||
]]>
|
||||
</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
|
||||
-->
|
||||
47
docs/es/programmers/plugins/plugins-howto.xml
Normal file
47
docs/es/programmers/plugins/plugins-howto.xml
Normal file
@@ -0,0 +1,47 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="plugins.howto">
|
||||
<title>Como funcionan los Plugins</title>
|
||||
<para>
|
||||
Los plugins son siempre cargados cuando son requeridos. solo los
|
||||
calificativos especificos, funciones, recursos, etc convocados en
|
||||
scripts del template seran leidos. Adem<65>s, cada plugin es cargado
|
||||
una sola vez, aun si usted tiene corriendo varias instancias
|
||||
diferentes de Smarty dentro de la misma petici<63>n.
|
||||
</para>
|
||||
<para>
|
||||
Pre/posfiltros y salidas de filtros son una parte de un caso especial.
|
||||
Dado que ellos no son mensionados en los templates, ellos deben ser
|
||||
registrados o leidos explicitamente mediante funciones de API antes de
|
||||
que el template sea procesado. El orden en el cual son ejecutados
|
||||
multiples filtros del mismo tipo depende del orden en el que estos son
|
||||
registrados o leidos.
|
||||
</para>
|
||||
<para>
|
||||
El <link linkend="variable.plugins.dir">directorio de directory</link>
|
||||
puede ser una cadena que contenga una ruta o un arreglo que contenga
|
||||
multiples rutas. Para instalar un plugin, simplemente coloquelo en el
|
||||
directorio y el Smarty lo usara autom<6F>ticamente.
|
||||
</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
|
||||
-->
|
||||
74
docs/es/programmers/plugins/plugins-inserts.xml
Normal file
74
docs/es/programmers/plugins/plugins-inserts.xml
Normal file
@@ -0,0 +1,74 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="plugins.inserts"><title>Inserts</title>
|
||||
<para>
|
||||
Los Plugins Insert son usados para implementar funciones que son
|
||||
invocadas por las etiquetas
|
||||
<link linkend="language.function.insert"><command>insert</command></link>
|
||||
en el template.
|
||||
</para>
|
||||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
<funcdef>string <function>smarty_insert_<replaceable>name</replaceable></function></funcdef>
|
||||
<paramdef>array <parameter>$params</parameter></paramdef>
|
||||
<paramdef>object <parameter>&$smarty</parameter></paramdef>
|
||||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
<para>
|
||||
El primer par<61>metro de la funci<63>n es un arreglo asociativo de
|
||||
atributos pasados al insert.
|
||||
</para>
|
||||
<para>
|
||||
La funci<63>n insert debe retornar el resultado que ira a sustituir
|
||||
el lugar de la etiqueta <command>insert</command> en el template.
|
||||
</para>
|
||||
<example>
|
||||
<title>insert plugin</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
/*
|
||||
* Smarty plugin
|
||||
* -------------------------------------------------------------
|
||||
* File: insert.time.php
|
||||
* Type: time
|
||||
* Name: time
|
||||
* Purpose: Inserts current date/time according to format
|
||||
* -------------------------------------------------------------
|
||||
*/
|
||||
function smarty_insert_time($params, &$smarty)
|
||||
{
|
||||
if (empty($params['format'])) {
|
||||
$smarty->trigger_error("insert time: missing 'format' parameter");
|
||||
return;
|
||||
}
|
||||
|
||||
$datetime = strftime($params['format']);
|
||||
return $datetime;
|
||||
}
|
||||
?>
|
||||
]]>
|
||||
</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
|
||||
-->
|
||||
115
docs/es/programmers/plugins/plugins-modifiers.xml
Normal file
115
docs/es/programmers/plugins/plugins-modifiers.xml
Normal file
@@ -0,0 +1,115 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="plugins.modifiers"><title>Modificadores</title>
|
||||
<para>
|
||||
Los modificadores son funciones que son aplicadas a una variable
|
||||
en el template antes de ser mostrada o usada en algun otro contexto.
|
||||
Los modificadores pueden ser encadenados conjuntamente.
|
||||
</para>
|
||||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
<funcdef>mixed <function>smarty_modifier_<replaceable>name</replaceable></function></funcdef>
|
||||
<paramdef>mixed <parameter>$value</parameter></paramdef>
|
||||
<paramdef>[mixed <parameter>$param1</parameter>, ...]</paramdef>
|
||||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
<para>
|
||||
El primer par<61>metro en el modificador de plugin es el valor sobre
|
||||
el cual el modificador es precisa para funcionar. El resto de los
|
||||
par<61>metros pueden ser opcionales, dependiendo de cual tipo de operaci<63>n
|
||||
va a ser ejecutada.
|
||||
</para>
|
||||
<para>
|
||||
El modificador debe retornar el resultado de su procesamiento.
|
||||
</para>
|
||||
<para>
|
||||
Vea Tambien
|
||||
<link linkend="api.register.modifier">register_modifier()</link>,
|
||||
<link linkend="api.unregister.modifier">unregister_modifier()</link>.
|
||||
</para>
|
||||
<example>
|
||||
<title> Plugin modificador simple</title>
|
||||
<para>
|
||||
Este plugin b<>sicamente es un alias de una funci<63>n incorporada
|
||||
en PHP. Este no tiene ningun par<61>metro adicional.
|
||||
</para>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
/*
|
||||
* Smarty plugin
|
||||
* -------------------------------------------------------------
|
||||
* File: modifier.capitalize.php
|
||||
* Type: modifier
|
||||
* Name: capitalize
|
||||
* Purpose: capitalize words in the string
|
||||
* -------------------------------------------------------------
|
||||
*/
|
||||
function smarty_modifier_capitalize($string)
|
||||
{
|
||||
return ucwords($string);
|
||||
}
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para></para>
|
||||
<example>
|
||||
<title>Plugin modificador mas complejo</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
/*
|
||||
* Smarty plugin
|
||||
* -------------------------------------------------------------
|
||||
* File: modifier.truncate.php
|
||||
* Type: modifier
|
||||
* Name: truncate
|
||||
* Purpose: Truncate a string to a certain length if necessary,
|
||||
* optionally splitting in the middle of a word, and
|
||||
* appending the $etc string.
|
||||
* -------------------------------------------------------------
|
||||
*/
|
||||
function smarty_modifier_truncate($string, $length = 80, $etc = '...',
|
||||
$break_words = false)
|
||||
{
|
||||
if ($length == 0)
|
||||
return '';
|
||||
|
||||
if (strlen($string) > $length) {
|
||||
$length -= strlen($etc);
|
||||
$fragment = substr($string, 0, $length+1);
|
||||
if ($break_words)
|
||||
$fragment = substr($fragment, 0, -1);
|
||||
else
|
||||
$fragment = preg_replace('/\s+(\S+)?$/', '', $fragment);
|
||||
return $fragment.$etc;
|
||||
} else
|
||||
return $string;
|
||||
}
|
||||
?>
|
||||
]]>
|
||||
</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
|
||||
-->
|
||||
81
docs/es/programmers/plugins/plugins-naming-conventions.xml
Normal file
81
docs/es/programmers/plugins/plugins-naming-conventions.xml
Normal file
@@ -0,0 +1,81 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="plugins.naming.conventions">
|
||||
<title>Nombres convensionales</title>
|
||||
<para>
|
||||
Los archivos y funciones de Plugin deben seguir una convenci<63>n
|
||||
de apariencia muy especifica a fin de que pueda ser localizada
|
||||
por el Smarty.
|
||||
</para>
|
||||
<para>
|
||||
Los archivos de plugin deben ser nombrados de la siguiente forma:
|
||||
<blockquote>
|
||||
<para>
|
||||
<filename>
|
||||
<replaceable>type</replaceable>.<replaceable>name</replaceable>.php
|
||||
</filename>
|
||||
</para>
|
||||
</blockquote>
|
||||
</para>
|
||||
<para>
|
||||
Donde <literal>type</literal> es uno de los siguientes tipo de plugin:
|
||||
<itemizedlist spacing="compact">
|
||||
<listitem><simpara>function</simpara></listitem>
|
||||
<listitem><simpara>modifier</simpara></listitem>
|
||||
<listitem><simpara>block</simpara></listitem>
|
||||
<listitem><simpara>compiler</simpara></listitem>
|
||||
<listitem><simpara>prefilter</simpara></listitem>
|
||||
<listitem><simpara>postfilter</simpara></listitem>
|
||||
<listitem><simpara>outputfilter</simpara></listitem>
|
||||
<listitem><simpara>resource</simpara></listitem>
|
||||
<listitem><simpara>insert</simpara></listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
<para>
|
||||
Y <literal>name</literal> seria un identificador valido (solo, letras,
|
||||
n<>meros, y underscores).
|
||||
</para>
|
||||
<para>
|
||||
Algunos ejemplos: <literal>function.html_select_date.php</literal>,
|
||||
<literal>resource.db.php</literal>, <literal>modifier.spacify.php</literal>.
|
||||
</para>
|
||||
<para>
|
||||
Las funciones de plugin dentro de los archivos de plugin deben ser
|
||||
nombradas de la siguiente forma:
|
||||
<blockquote>
|
||||
<para>
|
||||
<function>smarty_<replaceable>type</replaceable>_<replaceable>name</replaceable></function>
|
||||
</para>
|
||||
</blockquote>
|
||||
</para>
|
||||
<para>
|
||||
El significado de <literal>type</literal> and <literal>name</literal> son
|
||||
los mismo que loas anteriores.
|
||||
</para>
|
||||
<para>
|
||||
El Smarty mostrara mensajes de error apropiados si el archivo de
|
||||
plugins que es necesario no es encontrado, o si el archivo a la
|
||||
funci<63>n de plugin esta nombrado inadecuadamente.
|
||||
</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
|
||||
-->
|
||||
67
docs/es/programmers/plugins/plugins-outputfilters.xml
Normal file
67
docs/es/programmers/plugins/plugins-outputfilters.xml
Normal file
@@ -0,0 +1,67 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="plugins.outputfilters"><title>Filtros de Salida</title>
|
||||
<para>
|
||||
Los Filtros de salida operan en la salida del template, despu<70>s
|
||||
que el template es cargado y ejecutado, pero antes que la salida
|
||||
sea mostrada.
|
||||
</para>
|
||||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
<funcdef>string <function>smarty_outputfilter_<replaceable>name</replaceable></function></funcdef>
|
||||
<paramdef>string <parameter>$template_output</parameter></paramdef>
|
||||
<paramdef>object <parameter>&$smarty</parameter></paramdef>
|
||||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
<para>
|
||||
El primer par<61>metro de la funci<63>n de filtro de salida es la
|
||||
salida del template que necesita ser procesada, y el segundo
|
||||
par<61>metro es la instancia del Smarty invocando el plugin.
|
||||
El plugin debe hacer el procesamiento y retornar los resultados.
|
||||
</para>
|
||||
<example>
|
||||
<title>plugin de filtro de salida</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
/*
|
||||
* Smarty plugin
|
||||
* -------------------------------------------------------------
|
||||
* File: outputfilter.protect_email.php
|
||||
* Type: outputfilter
|
||||
* Name: protect_email
|
||||
* Purpose: Converts @ sign in email addresses to %40 as
|
||||
* a simple protection against spambots
|
||||
* -------------------------------------------------------------
|
||||
*/
|
||||
function smarty_outputfilter_protect_email($output, &$smarty)
|
||||
{
|
||||
return preg_replace('!(\S+)@([a-zA-Z0-9\.\-]+\.([a-zA-Z]{2,3}|[0-9]{1,3}))!',
|
||||
'$1%40$2', $output);
|
||||
}
|
||||
?>
|
||||
]]>
|
||||
</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
|
||||
-->
|
||||
108
docs/es/programmers/plugins/plugins-prefilters-postfilters.xml
Normal file
108
docs/es/programmers/plugins/plugins-prefilters-postfilters.xml
Normal file
@@ -0,0 +1,108 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="plugins.prefilters.postfilters">
|
||||
<title>Prefiltros/Postfiltros</title>
|
||||
<para>
|
||||
Los Plugins Prefilter y postfilter con muy similares en concepto;
|
||||
donde ellos difieren es en la ejecuci<63>n -- mas precisamente en el
|
||||
tiempo sus ejecuciones.
|
||||
</para>
|
||||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
<funcdef>string <function>smarty_prefilter_<replaceable>name</replaceable></function></funcdef>
|
||||
<paramdef>string <parameter>$source</parameter></paramdef>
|
||||
<paramdef>object <parameter>&$smarty</parameter></paramdef>
|
||||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
<para>
|
||||
Los Prefilters son usados para procesar el fuente del template
|
||||
inmediatamente antes de la compilaci<63>n. El primer par<61>metro de
|
||||
la funci<63>n del prefilter es el fuente del template, posiblemente
|
||||
modificado por algunos otros prefilters. El Plugin es supuesto
|
||||
que retorne el fuente modificado. Observe que este c<>digo no
|
||||
es salvado en ningun lugar, este es solo usado para la compilaci<63>n.
|
||||
</para>
|
||||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
<funcdef>string <function>smarty_postfilter_<replaceable>name</replaceable></function></funcdef>
|
||||
<paramdef>string <parameter>$compiled</parameter></paramdef>
|
||||
<paramdef>object <parameter>&$smarty</parameter></paramdef>
|
||||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
<para>
|
||||
Los Postfilters son usados para procesar la salida compilada del
|
||||
template (el c<>digo PHP) inmediatamente despu<70>s de que la compilacion
|
||||
es terminada pero antes de que el template compilado sea salvado en
|
||||
el sistema de archivos. El primer par<61>metro para la funci<63>n postfilter
|
||||
es el c<>digo del template compilado, posiblemente modificado por otros
|
||||
postfilters. El plugin es supuesto que retorne la versi<73>n modificada
|
||||
de este codigo.
|
||||
</para>
|
||||
<example>
|
||||
<title>prefilter plugin</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
/*
|
||||
* Smarty plugin
|
||||
* -------------------------------------------------------------
|
||||
* File: prefilter.pre01.php
|
||||
* Type: prefilter
|
||||
* Name: pre01
|
||||
* Purpose: Convert html tags to be lowercase.
|
||||
* -------------------------------------------------------------
|
||||
*/
|
||||
function smarty_prefilter_pre01($source, &$smarty)
|
||||
{
|
||||
return preg_replace('!<(\w+)[^>]+>!e', 'strtolower("$1")', $source);
|
||||
}
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para></para>
|
||||
<example>
|
||||
<title>postfilter plugin</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
/*
|
||||
* Smarty plugin
|
||||
* -------------------------------------------------------------
|
||||
* File: postfilter.post01.php
|
||||
* Type: postfilter
|
||||
* Name: post01
|
||||
* Purpose: Output code that lists all current template vars.
|
||||
* -------------------------------------------------------------
|
||||
*/
|
||||
function smarty_postfilter_post01($compiled, &$smarty)
|
||||
{
|
||||
$compiled = "<pre>\n<?php print_r(\$this->get_template_vars()); ?>\n</pre>" . $compiled;
|
||||
return $compiled;
|
||||
}
|
||||
?>
|
||||
]]>
|
||||
</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
|
||||
-->
|
||||
162
docs/es/programmers/plugins/plugins-resources.xml
Normal file
162
docs/es/programmers/plugins/plugins-resources.xml
Normal file
@@ -0,0 +1,162 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="plugins.resources"><title>Fuentes</title>
|
||||
<para>
|
||||
Las fuentes de los plugins son como una forma generica de suministrar
|
||||
c<>digo fuente de template o componentes de script PHP al Smarty.
|
||||
Algunos ejemplos de fuentes: base de datos, LDAP, memoria compartida,
|
||||
sockets, etc.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Existe un total de 4 funciones que necesitan estar registradas para
|
||||
cada tipo de fuente. Cada funci<63>n recibir<69> el fuente requerido como
|
||||
primer par<61>metro y el objeto de Smarty como ultimo par<61>metro.
|
||||
El resto de los par<61>metros dependen de la funci<63>n.
|
||||
</para>
|
||||
|
||||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
<funcdef>bool <function>smarty_resource_<replaceable>name</replaceable>_source</function></funcdef>
|
||||
<paramdef>string <parameter>$rsrc_name</parameter></paramdef>
|
||||
<paramdef>string <parameter>&$source</parameter></paramdef>
|
||||
<paramdef>object <parameter>&$smarty</parameter></paramdef>
|
||||
</funcprototype>
|
||||
<funcprototype>
|
||||
<funcdef>bool <function>smarty_resource_<replaceable>name</replaceable>_timestamp</function></funcdef>
|
||||
<paramdef>string <parameter>$rsrc_name</parameter></paramdef>
|
||||
<paramdef>int <parameter>&$timestamp</parameter></paramdef>
|
||||
<paramdef>object <parameter>&$smarty</parameter></paramdef>
|
||||
</funcprototype>
|
||||
<funcprototype>
|
||||
<funcdef>bool <function>smarty_resource_<replaceable>name</replaceable>_secure</function></funcdef>
|
||||
<paramdef>string <parameter>$rsrc_name</parameter></paramdef>
|
||||
<paramdef>object <parameter>&$smarty</parameter></paramdef>
|
||||
</funcprototype>
|
||||
<funcprototype>
|
||||
<funcdef>bool <function>smarty_resource_<replaceable>name</replaceable>_trusted</function></funcdef>
|
||||
<paramdef>string <parameter>$rsrc_name</parameter></paramdef>
|
||||
<paramdef>object <parameter>&$smarty</parameter></paramdef>
|
||||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
|
||||
<para>
|
||||
La primera funci<63>n debe devolver el recurso.
|
||||
Su segundo par<61>metro es una variable pasada por referencia donde
|
||||
el resultado debe ser almacenado.
|
||||
La funci<63>n debe retornar <literal>true</literal> si esta pudo
|
||||
recuperar satisfactoriamente el recurso y en caso contrario
|
||||
retornara <literal>false</literal>.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
La segunda funci<63>n debe devolver la ultima modificaci<63>n del
|
||||
recurso requerido (como un timestamp Unix). El segundo par<61>metro
|
||||
es una variable pasada por referencia donde el timestamp sera
|
||||
almacenado. La funci<63>n debe retornar <literal>true</literal>
|
||||
si el timestamp pudo ser determinado satisfactoriamente, y en
|
||||
caso contrario retornara <literal>false</literal>.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
La tercera funci<63>n debe retornar <literal>true</literal> o
|
||||
<literal>false</literal>, dependiendo si el recurso requerido
|
||||
es seguro o no. Esta funci<63>n es usada solo para recursos de
|
||||
template pero esta debe ser definida.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
La cuarta funci<63>n debe retornar <literal>true</literal> o
|
||||
<literal>false</literal>, dependiendo si el recurso requerido
|
||||
es seguro o no. Esta funci<63>n es usada solo para componetes de
|
||||
script de PHP solicitado por las etiquetas
|
||||
<command>include_php</command> o <command>insert</command>
|
||||
con el atributo <structfield>src</structfield>. Sin embargo,
|
||||
este debe ser definido para los recurso del template.
|
||||
</para>
|
||||
<para>
|
||||
Vea tambi<62>n
|
||||
<link linkend="api.register.resource">register_resource()</link>,
|
||||
<link linkend="api.unregister.resource">unregister_resource()</link>.
|
||||
</para>
|
||||
<example>
|
||||
<title>Plugin resource (recurso)</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
/*
|
||||
* Smarty plugin
|
||||
* -------------------------------------------------------------
|
||||
* File: resource.db.php
|
||||
* Type: resource
|
||||
* Name: db
|
||||
* Purpose: Fetches templates from a database
|
||||
* -------------------------------------------------------------
|
||||
*/
|
||||
function smarty_resource_db_source($tpl_name, &$tpl_source, &$smarty)
|
||||
{
|
||||
// do database call here to fetch your template,
|
||||
// populating $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 smarty_resource_db_timestamp($tpl_name, &$tpl_timestamp, &$smarty)
|
||||
{
|
||||
// do database call here to populate $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 smarty_resource_db_secure($tpl_name, &$smarty)
|
||||
{
|
||||
// assume all templates are secure
|
||||
return true;
|
||||
}
|
||||
|
||||
function smarty_resource_db_trusted($tpl_name, &$smarty)
|
||||
{
|
||||
// not used for templates
|
||||
}
|
||||
?>
|
||||
]]>
|
||||
</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
|
||||
-->
|
||||
57
docs/es/programmers/plugins/plugins-writing.xml
Normal file
57
docs/es/programmers/plugins/plugins-writing.xml
Normal file
@@ -0,0 +1,57 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="plugins.writing">
|
||||
<title>Escribiendo Plugins</title>
|
||||
<para>
|
||||
Los Plugins pueden ser leidos por el Smarty autom<6F>ticamente del
|
||||
sistema de archivos o pueden ser registrados en tiempo de
|
||||
ejecuci<63>n por medio de una de las funciones de API register_* .
|
||||
Estos tambi<62>n pueden ser usados con la funci<63>n API unregister_*.
|
||||
</para>
|
||||
<para>
|
||||
Para los plugins que son registrados en tiempo de ejecuci<63>n, el
|
||||
nombre de la(s) funci<63>n(es) de plugin no tiene que seguir la
|
||||
convenci<63>n de apariencia.
|
||||
</para>
|
||||
<para>
|
||||
Si un plugin depende de alguna funci<63>n alimentada por otro plugin
|
||||
(como es el caso con algunos plugins incrustados con el Smarty),
|
||||
entonces la forma apropiada para leer el plugin necesario es esta:
|
||||
</para>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
require_once $smarty->_get_plugin_filepath('function', 'html_options');
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Como regla general, el objeto Smarty siempre es pasado a los
|
||||
plugins como ultimo par<61>metro (con dos excepciones: los
|
||||
modificadores no pasan el objeto de Smarty del todo y los
|
||||
blocks obtenidos son pasados <parameter>&$repeat</parameter>
|
||||
despu<70>s el objeto de Smarty para manter compatibilidad con
|
||||
antiguas versiones de Smarty).
|
||||
</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
|
||||
-->
|
||||
49
docs/es/programmers/smarty-constants.xml
Normal file
49
docs/es/programmers/smarty-constants.xml
Normal file
@@ -0,0 +1,49 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<chapter id="smarty.constants">
|
||||
<title>Constantes</title>
|
||||
|
||||
<sect1 id="constant.smarty.dir">
|
||||
<title>SMARTY_DIR</title>
|
||||
<para>
|
||||
Esta debe ser la ruta completa del path para la localizaci<63>n
|
||||
de los archivos de clases de Smarty. Si esta no fuera definida,
|
||||
Entonces Smarty intentara determinar el valor apropiado
|
||||
autom<6F>ticamente. Si es definido, el path debe finalizar con una
|
||||
diagonal.
|
||||
</para>
|
||||
<example>
|
||||
<title>SMARTY_DIR</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
// determinando la ruta del directorio Smarty
|
||||
define("SMARTY_DIR","/usr/local/lib/php/Smarty/");
|
||||
|
||||
require_once(SMARTY_DIR."Smarty.class.php");
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</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
|
||||
-->
|
||||
Reference in New Issue
Block a user