block.php.php 615 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. /**
  3. * Smarty plugin to execute PHP code
  4. *
  5. * @package Smarty
  6. * @subpackage PluginsBlock
  7. * @author Uwe Tews
  8. */
  9. /**
  10. * Smarty {php}{/php} block plugin
  11. *
  12. * @param string $content contents of the block
  13. * @param object $smarty Smarty object
  14. * @param boolean $ &$repeat repeat flag
  15. * @param object $template template object
  16. * @return string content re-formatted
  17. */
  18. function smarty_block_php($params, $content, $smarty, &$repeat, $template)
  19. {
  20. if (!$smarty->allow_php_tag) {
  21. throw new Exception("{php} is deprecated, set allow_php_tag = true to enable");
  22. }
  23. eval($content);
  24. return '';
  25. }
  26. ?>