mirror of
				https://github.com/smarty-php/smarty.git
				synced 2025-11-03 05:41:37 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			39 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			39 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
<?php
 | 
						|
/**
 | 
						|
* Smarty Internal Plugin Compile Block
 | 
						|
* 
 | 
						|
* Compiles the {block} tag
 | 
						|
* 
 | 
						|
* @package Smarty
 | 
						|
* @subpackage Compiler
 | 
						|
* @author Uwe Tews 
 | 
						|
*/
 | 
						|
/**
 | 
						|
* Smarty Internal Plugin Compile Block Class
 | 
						|
*/
 | 
						|
class Smarty_Internal_Compile_Block extends Smarty_Internal_CompileBase {
 | 
						|
    /**
 | 
						|
    * Compiles code for the {block} tag
 | 
						|
    * 
 | 
						|
    * @param array $args array with attributes from parser
 | 
						|
    * @param object $compiler compiler object
 | 
						|
    * @return boolean true
 | 
						|
    */
 | 
						|
    public function compile($args, $compiler)
 | 
						|
    {
 | 
						|
        $this->compiler = $compiler;
 | 
						|
        $this->required_attributes = array('name');
 | 
						|
        $this->optional_attributes = array('assign'); 
 | 
						|
        // check and get attributes
 | 
						|
        $_attr = $this->_get_attributes($args);
 | 
						|
        $save = array($_attr, $compiler->template->extracted_compiled_code, $compiler->template->extract_code); 
 | 
						|
        $this->_open_tag('block', $save);
 | 
						|
        $compiler->template->extract_code = true;
 | 
						|
        $compiler->template->extracted_compiled_code = '';
 | 
						|
        $compiler->template->has_code = false; 
 | 
						|
        return true;
 | 
						|
    } 
 | 
						|
} 
 | 
						|
 | 
						|
?>
 |