mirror of
https://github.com/smarty-php/smarty.git
synced 2025-10-26 18:01:36 +01:00
69 lines
2.0 KiB
XML
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<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
|
|||
|
|
-->
|