add nl2br modifier

This commit is contained in:
mohrt
2003-02-26 22:16:14 +00:00
parent edcf2aee05
commit 5006d4d510
2 changed files with 27 additions and 1 deletions

3
NEWS
View File

@@ -1,5 +1,6 @@
- added nl2br modifier to distribution (Monte)
- added html_image to distribution (Monte) - added html_image to distribution (Monte)
- added cat modifier (Monte) - added cat modifier to distribution (Monte)
- added << >> <> support to if statments (SMK, Monte) - added << >> <> support to if statments (SMK, Monte)
- fix _assign_smarty_interface to not overwrite keys - fix _assign_smarty_interface to not overwrite keys
other than 'request' (Jerome Poudevigne, Monte) other than 'request' (Jerome Poudevigne, Monte)

View File

@@ -0,0 +1,25 @@
<?php
/*
* Smarty plugin
* -------------------------------------------------------------
* Type: modifier
* Name: nl2br
* Version: 1.0
* Date: Feb 26, 2003
* Author: Monte Ohrt <monte@ispi.net>
* Purpose: convert \r\n, \r or \n to <br />
* Input: contents = contents to replace
* preceed_test = if true, includes preceeding break tags
* in replacement
* Example: {$text|nl2br}
* -------------------------------------------------------------
*/
function smarty_modifier_nl2br($string)
{
return nl2br($string);
}
/* vim: set expandtab: */
?>