2008-12-23 20:32:55 +00:00
|
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
2004-10-07 18:50:52 +00:00
|
|
|
|
<!-- $Revision$ -->
|
|
|
|
|
|
<refentry id="api.register.modifier">
|
|
|
|
|
|
<refnamediv>
|
2005-11-08 23:37:29 +00:00
|
|
|
|
<refname>register_modifier()</refname>
|
|
|
|
|
|
<refpurpose>mofidica din<69>micamente plugins registrados</refpurpose>
|
2004-10-07 18:50:52 +00:00
|
|
|
|
</refnamediv>
|
|
|
|
|
|
<refsect1>
|
2005-11-08 23:37:29 +00:00
|
|
|
|
<title>Descripci<EFBFBD>n</title>
|
2004-10-07 18:50:52 +00:00
|
|
|
|
<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>
|
|
|
|
|
|
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
|
|
|
|
|
|
</para>
|
2005-11-08 23:37:29 +00:00
|
|
|
|
<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>
|
2004-10-07 18:50:52 +00:00
|
|
|
|
<example>
|
2005-11-08 23:37:29 +00:00
|
|
|
|
<title>register_modifier()</title>
|
|
|
|
|
|
<programlisting role="php">
|
2004-10-07 18:50:52 +00:00
|
|
|
|
<![CDATA[
|
|
|
|
|
|
<?php
|
|
|
|
|
|
|
2005-11-08 23:37:29 +00:00
|
|
|
|
// let's map PHP's stripslashes function to a Smarty modifier.
|
|
|
|
|
|
$smarty->register_modifier('sslash', 'stripslashes');
|
2004-10-07 18:50:52 +00:00
|
|
|
|
|
|
|
|
|
|
?>
|
|
|
|
|
|
]]>
|
2005-11-08 23:37:29 +00:00
|
|
|
|
</programlisting>
|
|
|
|
|
|
<para>template</para>
|
|
|
|
|
|
<programlisting>
|
|
|
|
|
|
<![CDATA[
|
|
|
|
|
|
<?php
|
|
|
|
|
|
{* use 'sslash' to strip slashes from variables *}
|
|
|
|
|
|
{$var|sslash}
|
|
|
|
|
|
?>
|
|
|
|
|
|
]]>
|
|
|
|
|
|
</programlisting>
|
|
|
|
|
|
|
2004-10-07 18:50:52 +00:00
|
|
|
|
</example>
|
2005-11-08 23:37:29 +00:00
|
|
|
|
<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>
|
2004-10-07 18:50:52 +00:00
|
|
|
|
</refsect1>
|
|
|
|
|
|
</refentry>
|
2005-11-08 23:37:29 +00:00
|
|
|
|
|
2004-10-07 18:50:52 +00:00
|
|
|
|
<!-- 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
|
|
|
|
|
|
-->
|