mirror of
				https://github.com/smarty-php/smarty.git
				synced 2025-11-03 13:51:36 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			28 lines
		
	
	
		
			635 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			28 lines
		
	
	
		
			635 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
<?php
 | 
						|
/**
 | 
						|
 * Smarty plugin to execute PHP code
 | 
						|
 * 
 | 
						|
 * @package Smarty
 | 
						|
 * @subpackage PluginsBlock
 | 
						|
 * @author Uwe Tews 
 | 
						|
 */
 | 
						|
 | 
						|
/**
 | 
						|
 * Smarty {php}{/php} block plugin
 | 
						|
 * 
 | 
						|
 * @param string $content contents of the block
 | 
						|
 * @param object $smarty Smarty object
 | 
						|
 * @param boolean $ &$repeat repeat flag
 | 
						|
 * @param object $template template object
 | 
						|
 * @return string content re-formatted
 | 
						|
 */
 | 
						|
function smarty_block_php($params, $content, $smarty, &$repeat, $template)
 | 
						|
{ 
 | 
						|
    if (!$smarty->allow_php_tag) {
 | 
						|
        throw new SmartyException("{php} is deprecated, set allow_php_tag = true to enable");
 | 
						|
    } 
 | 
						|
    eval($content);
 | 
						|
    return '';
 | 
						|
}
 | 
						|
 | 
						|
?>
 |