/framework/vendor/smarty2/lib/plugins/modifier.nl2br.php

http://zoop.googlecode.com/ · PHP · 35 lines · 6 code · 4 blank · 25 comment · 0 complexity · 1d16b98e8ec34aac69f0827fab1dc999 MD5 · raw file

  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. ?>