modifier.nl2br.php 717 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. /**
  3. * Smarty plugin
  4. * @package Smarty
  5. * @subpackage plugins
  6. */
  7. /**
  8. * Smarty plugin
  9. *
  10. * Type: modifier<br>
  11. * Name: nl2br<br>
  12. * Date: Feb 26, 2003
  13. * Purpose: convert \r\n, \r or \n to <<br>>
  14. * Input:<br>
  15. * - contents = contents to replace
  16. * - preceed_test = if true, includes preceeding break tags
  17. * in replacement
  18. * Example: {$text|nl2br}
  19. * @link http://smarty.php.net/manual/en/language.modifier.nl2br.php
  20. * nl2br (Smarty online manual)
  21. * @version 1.0
  22. * @author Monte Ohrt <monte at ohrt dot com>
  23. * @param string
  24. * @return string
  25. */
  26. function smarty_modifier_nl2br($string)
  27. {
  28. return nl2br($string);
  29. }
  30. /* vim: set expandtab: */
  31. ?>