Files
smarty/docs/es/programmers/api-functions/api-register-modifier.xml
2004-10-07 18:50:52 +00:00

69 lines
2.0 KiB
XML

<?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ámicamente plugins registrados.
Pase en el template el nombre del modificador, seguido de la
funció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ón o
(b) un arreglo en el formato
<literal>array(&amp;$object, $method)</literal> con
<literal>&amp;$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(&amp;$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
-->