Содержимое файла | Последнее изменение | Открыть журнал | RSS
Редакция | Автор | № строки | Строка |
---|---|---|---|
304 | alex-w | 1 | <?php |
2 | /** |
||
3 | * Smarty Internal Plugin Compile Capture Close |
||
4 | * |
||
5 | * Compiles the {/capture} tag |
||
6 | * @package Smarty |
||
7 | * @subpackage Compiler |
||
8 | * @author Uwe Tews |
||
9 | */ |
||
10 | /** |
||
11 | * Smarty Internal Plugin Compile CaptureClose Class |
||
12 | */ |
||
13 | class Smarty_Internal_Compile_CaptureClose 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 | // check and get attributes |
||
25 | $_attr = $this->_get_attributes($args); |
||
26 | |||
27 | $saved_attr = $this->_close_tag(array('capture')); |
||
28 | |||
29 | $_output = "<?php "; |
||
30 | if (isset($saved_attr[1])) { |
||
31 | $_output .= " \$_smarty_tpl->assign($saved_attr[1], ob_get_contents());"; |
||
32 | } |
||
33 | $_output .= " \$_smarty_tpl->smarty->_smarty_vars['capture'][$saved_attr[0]]=ob_get_clean(); ?>\n"; |
||
34 | return $_output; |
||
35 | } |
||
36 | } |
||
37 | |||
38 | ?> |