modifier.string_format.php 617 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. /**
  3. * Smarty plugin
  4. *
  5. * @package Smarty
  6. * @subpackage PluginsModifier
  7. */
  8. /**
  9. * Smarty string_format modifier plugin
  10. *
  11. * Type: modifier<br>
  12. * Name: string_format<br>
  13. * Purpose: format strings via sprintf
  14. *
  15. * @link http://smarty.php.net/manual/en/language.modifier.string.format.php string_format (Smarty online manual)
  16. * @author Monte Ohrt <monte at ohrt dot com>
  17. * @param string $string input string
  18. * @param string $format format string
  19. * @return string formatted string
  20. */
  21. function smarty_modifier_string_format($string, $format)
  22. {
  23. return sprintf($format, $string);
  24. }
  25. ?>