PageRenderTime 53ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

/lib/jelix/plugins/tpl/common/modifier.sprintf.php

https://bitbucket.org/jelix/jelix-trunk/
PHP | 25 lines | 5 code | 2 blank | 18 comment | 0 complexity | 11696b211b9eb695de6a68d2f58f2178 MD5 | raw file
Possible License(s): GPL-2.0, LGPL-2.1, BSD-3-Clause, JSON, GPL-3.0, LGPL-3.0
  1. <?php
  2. /**
  3. * Plugin from smarty project and adapted for jtpl
  4. * @package jelix
  5. * @subpackage jtpl_plugin
  6. * @copyright 2001-2003 ispi of Lincoln, Inc.
  7. * @link http://smarty.php.net/
  8. * @link http://jelix.org/
  9. * @licence GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html
  10. */
  11. /**
  12. * modifier plugin : format strings via sprintf
  13. *
  14. * <pre>{$mytext|sprintf:'my format %s'}</pre>
  15. * @param string $string
  16. * @param string $format
  17. * @return string
  18. * @see sprintf
  19. */
  20. function jtpl_modifier_common_sprintf($string, $format)
  21. {
  22. return sprintf($format, $string);
  23. }