Хранилища Subversion ant

Редакция

Содержимое файла | Последнее изменение | Открыть журнал | RSS

Редакция Автор № строки Строка
304 alex-w 1
<?php
2
/**
3
* Smarty Internal Plugin Compile Capture
4
*
5
* Compiles the {capture} tag
6
* @package Smarty
7
* @subpackage Compiler
8
* @author Uwe Tews
9
*/
10
/**
11
* Smarty Internal Plugin Compile Capture Class
12
*/
13
class Smarty_Internal_Compile_Capture extends Smarty_Internal_CompileBase {
14
    /**
15
    * Compiles code for the {capture} tag
16
    *
17
    * @param array $args array with attributes from parser
18
    * @param object $compiler compiler object
19
    * @return string compiled code
20
    */
21
    public function compile($args, $compiler)
22
    {
23
        $this->compiler = $compiler;
24
        $this->optional_attributes = array('name', 'assign');
25
        // check and get attributes
26
        $_attr = $this->_get_attributes($args);
27
 
28
        if (isset($_attr['name']))
29
            $buffer = $_attr['name'];
30
        else
31
            $buffer = "'default'";
32
 
33
        if (isset($_attr['assign']))
34
            $assign = $_attr['assign'];
35
        else
36
            $assign = null;
37
 
38
        $this->_open_tag('capture',array($buffer, $assign));
39
 
40
        $_output = "<?php ob_start(); ?>";
41
 
42
        return $_output;
43
    }
44
}
45
 
46
?>