mirror of
https://github.com/smarty-php/smarty.git
synced 2025-11-15 15:09:51 +01:00
huge sync with english by the translator (Mario Ramirez)
thanks
This commit is contained in:
@@ -2,50 +2,76 @@
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.register.modifier">
|
||||
<refnamediv>
|
||||
<refname>register_modifier</refname>
|
||||
<refpurpose></refpurpose>
|
||||
<refname>register_modifier()</refname>
|
||||
<refpurpose>mofidica din<69>micamente plugins registrados</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<title>Descripci<EFBFBD>n</title>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>register_modifier</methodname>
|
||||
<methodparam><type>string</type><parameter>name</parameter></methodparam>
|
||||
<methodparam><type>mixed</type><parameter>impl</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Use este para modificar din<69>micamente plugins registrados.
|
||||
Pase en el template el nombre del modificador, seguido de la
|
||||
funci<63>n PHP que implemente esto.
|
||||
</para>
|
||||
<para>
|
||||
La llamada de la funcion-php <parameter>impl</parameter> puede ser
|
||||
(a) una cadena conteniendo el nombre de la funci<63>n o
|
||||
(b) un arreglo en el formato
|
||||
<literal>array(&$object, $method)</literal> con
|
||||
<literal>&$object</literal> siendo una referencia para
|
||||
un objeto y <literal>$method</literal> siendo una cadena conteniendo
|
||||
el nombre del m<>todo o
|
||||
(c) un arreglo en el formato
|
||||
<literal>array(&$class, $method)</literal> con
|
||||
<literal>$class</literal> siendo un nombre de clase y
|
||||
<literal>$method</literal> siendo un m<>todo de esta clase.
|
||||
</para>
|
||||
<orderedlist numeration="loweralpha">
|
||||
<listitem>
|
||||
<para>una cadena conteniendo el nombre de la funci<63>n
|
||||
</para>
|
||||
</listitem><listitem>
|
||||
<para>un arreglo con la forma <literal>array(&$object, $method)</literal> con
|
||||
<literal>&$object</literal> siendo una referencia para un objeto y
|
||||
<literal>$method</literal> siendo una cadena conteniendo el nombre de un metodo
|
||||
</para>
|
||||
</listitem><listitem>
|
||||
<para>
|
||||
un arreglo con la forma
|
||||
<literal>array(&$class, $method)</literal> con
|
||||
<literal>$class</literal> siendo el nombre de una clase y
|
||||
<literal>$method</literal> siendo un metodo de esta clase.
|
||||
</para>
|
||||
</listitem>
|
||||
</orderedlist>
|
||||
<example>
|
||||
<title>register_modifier</title>
|
||||
<programlisting role="php">
|
||||
<title>register_modifier()</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
// let's map PHP's stripslashes function to a Smarty modifier.
|
||||
$smarty->register_modifier('sslash', 'stripslashes');
|
||||
|
||||
$smarty->register_modifier("sslash", "stripslashes");
|
||||
|
||||
// now you can use {$var|sslash} to strip slashes from variables
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</programlisting>
|
||||
<para>template</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
<?php
|
||||
{* use 'sslash' to strip slashes from variables *}
|
||||
{$var|sslash}
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
|
||||
</example>
|
||||
<para>
|
||||
Ver Tambi<62>n
|
||||
<link linkend="api.unregister.modifier">unregister_modifier()</link>,
|
||||
<link linkend="api.register.function">register_function()</link>,
|
||||
<link linkend="language.modifiers">modifiers</link>,
|
||||
<link linkend="plugins">Extending Smarty with plugins</link>
|
||||
y
|
||||
<link linkend="plugins.modifiers">Creating Plugin modifiers</link>,
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
|
||||
Reference in New Issue
Block a user