Содержимое файла | Последнее изменение | Открыть журнал | RSS
Редакция | Автор | № строки | Строка |
---|---|---|---|
304 | alex-w | 1 | <?php |
2 | /** |
||
3 | * Smarty Internal Plugin Compile Function |
||
4 | * |
||
5 | * Compiles the {function} tag |
||
6 | * |
||
7 | * @package Smarty |
||
8 | * @subpackage Compiler |
||
9 | * @author Uwe Tews |
||
10 | */ |
||
11 | /** |
||
12 | * Smarty Internal Plugin Compile Function Class |
||
13 | */ |
||
14 | class Smarty_Internal_Compile_Function extends Smarty_Internal_CompileBase { |
||
15 | /** |
||
16 | * Compiles code for the {function} tag |
||
17 | * |
||
18 | * @param array $args array with attributes from parser |
||
19 | * @param object $compiler compiler object |
||
20 | * @return boolean true |
||
21 | */ |
||
22 | public function compile($args, $compiler) |
||
23 | { |
||
24 | $this->compiler = $compiler; |
||
25 | $this->required_attributes = array('name'); |
||
26 | $this->optional_attributes = array('_any'); |
||
27 | // check and get attributes |
||
28 | $_attr = $this->_get_attributes($args); |
||
29 | $save = array($_attr, $compiler->template->extracted_compiled_code, $compiler->template->extract_code); |
||
30 | $this->_open_tag('function', $save); |
||
31 | $_name = trim($_attr['name'], "'"); |
||
32 | foreach ($_attr as $_key => $_data) { |
||
33 | $compiler->template->properties['function'][$_name]['parameter'][$_key] = $_data; |
||
34 | } |
||
35 | // make function known for recursive calls |
||
36 | $this->compiler->smarty->template_functions[$_name]['compiled'] = ''; |
||
37 | $compiler->template->extract_code = true; |
||
38 | $compiler->template->extracted_compiled_code = ''; |
||
39 | $compiler->template->has_code = false; |
||
40 | return true; |
||
41 | } |
||
42 | } |
||
43 | |||
44 | ?> |