mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-04 10:24:26 +02:00
add nl2br modifier
This commit is contained in:
3
NEWS
3
NEWS
@@ -1,5 +1,6 @@
|
||||
- added nl2br modifier 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)
|
||||
- fix _assign_smarty_interface to not overwrite keys
|
||||
other than 'request' (Jerome Poudevigne, Monte)
|
||||
|
25
libs/plugins/modifier.nl2br.php
Normal file
25
libs/plugins/modifier.nl2br.php
Normal 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: */
|
||||
|
||||
?>
|
Reference in New Issue
Block a user