php-es.org


Welcome! Here you can paste sources and general debugging text, You can even set yourself a password if you want to keep it just for yourself.

Posted by juchipilo on December Fri 2nd 9:23 PM - Never Expires
Download | New paste

  1. <?php
  2. /**
  3. * Smarty plugin
  4. * @package Smarty
  5. * @subpackage PluginsModifier
  6. */
  7.  
  8. /**
  9. * Smarty mygettext modifier plugin
  10. *
  11. * Type:     modifier<br>
  12. * Name:     mygettext<br>
  13. * Purpose:  return gettext translation for string
  14. *
  15. * @link
  16. * @author juchipilo
  17. * @param string
  18. * @return string
  19. */
  20. function smarty_modifier_mygettext($string)
  21. {
  22.         $string = trim($string);
  23.         return _($string);
  24. }
  25.  
  26.  
  27. /*
  28. Note: in your templates you will have stuf like this:
  29. {'I have a generic question'|mygettext}
  30. {'this is a string'|mygettext}
  31. */
  32.  
  33. ?>
Language:
To highlight particular lines, prefix each line with @@





© 2012 - Powered by PASTE 1.0