Get Smarty

Smarty Icon

You may use the Smarty logo according to the trademark notice.

Smarty Template Engine Smarty Template Engine

For sponsorship, advertising, news or other inquiries, contact us at:

Check reviews of PHP Web Hosting, compatible with Smarty Templates

Name

register_modifier() — mofidica dinámicamente plugins registrados

Descripción

void register_modifier(string name,
                       mixed impl);

Pase en el template el nombre del modificador, seguido de la función PHP que implemente esto.

La llamada de la funcion-php impl puede ser

  1. una cadena conteniendo el nombre de la función

  2. un arreglo con la forma array(&$object, $method) con &$object siendo una referencia para un objeto y $method siendo una cadena conteniendo el nombre de un metodo

  3. un arreglo con la forma array(&$class, $method) con $class siendo el nombre de una clase y $method siendo un metodo de esta clase.

Example 13.24. register_modifier()


<?php

// let's map PHP's stripslashes function to a Smarty modifier.
$smarty->register_modifier('sslash', 'stripslashes');

?>

template


<?php
{* use 'sslash' to strip slashes from variables *}
{$var|sslash}
?>


Ver También unregister_modifier(), register_function(), modifiers, Extending Smarty with plugins y Creating Plugin modifiers,

Comments
No comments for this page.
Post a Comment
All comments are moderated. Support questions are ignored, use the forums instead.
Author:
Email: (not shown)
What is 17 plus 13? (Are you human?)

Sponsors [info]

Cheap Website Hosting @hostdone.com
email marketing @ActiveCampaign
broadband deals @BroadbandGenie
Best UK Web Hosting @webhost.uk.net
Reliable UK and US Web Hosting @rshosting.com
Cheap US and UK Web Hosting @infrenion.com
I.T Certification Exams @pass-guaranteed.com
Certification Practice Tests @firsttrycertify.com
Certification Practice Exam Questions @ace-it-certifications.com
Broadband Speed Test @broadbandspeed.co.uk
bulk email software @americaint.com
ASP.NET hosting @aspnethosting.co.uk