Automatically exported from code.google.com/p/planningalerts
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

modifier.default.php 635 B

18 years ago
1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. /**
  3. * Smarty plugin
  4. * @package Smarty
  5. * @subpackage plugins
  6. */
  7. /**
  8. * Smarty default modifier plugin
  9. *
  10. * Type: modifier<br>
  11. * Name: default<br>
  12. * Purpose: designate default value for empty variables
  13. * @link http://smarty.php.net/manual/en/language.modifier.default.php
  14. * default (Smarty online manual)
  15. * @author Monte Ohrt <monte at ohrt dot com>
  16. * @param string
  17. * @param string
  18. * @return string
  19. */
  20. function smarty_modifier_default($string, $default = '')
  21. {
  22. if (!isset($string) || $string === '')
  23. return $default;
  24. else
  25. return $string;
  26. }
  27. /* vim: set expandtab: */
  28. ?>