Older Newer
Thu, 09 Apr 2009 21:40:20 . . . . p231n152.172.63.ruraltel.net


Changes by last author:

Added:
= Stripslashes=

This is a string modifier to remove slashes (for escaped strings)

Nathan Grebowiec

(suggestions, bug reports, etc can be directed to njgreb at gmail dot com)

== Usage ==

=== Sample Code ===

<code>

<?php

$smarty->assign("somestring","fruit\\'s");

?>

</code>

=== Sample Template ===

<code>

{$somestring}<br />

{$somestring|stripslashes}

</code>

=== Output ===

<code>

fruit\'s

fruit's

</code>

== Plugin Code ==

Copy the following code to modifier.stripslashes.php and put it in your smarty plugins directory.

(last updated 2009-04-09)

<code>

-------------------

<?php

/**

* Smarty plugin

* @package Smarty

* @subpackage plugins

*/

/**

* Smarty slash stripping plugin

*

* Type: modifier<br>

* Name: stripslashes<br>

* Purpose: remove slashes froma string

* @author Nathan Grebowiec <njgrebo at gmail dot com>

* @param string

* @return string

*/

function smarty_modifier_stripslashes($string)

{

return stripslashes($string);

}

?>

-------------------

</code>