Line | |
---|
1 | <?php |
---|
2 | |
---|
3 | /** |
---|
4 | * Inserts another template into the current one |
---|
5 | * <pre> |
---|
6 | * * file : the resource name of the template |
---|
7 | * * cache_time : cache length in seconds |
---|
8 | * * cache_id : cache identifier for the included template |
---|
9 | * * compile_id : compilation identifier for the included template |
---|
10 | * * data : data to feed into the included template, it can be any array and will default to $_root (the current data) |
---|
11 | * * assign : if set, the output of the included template will be saved in this variable instead of being output |
---|
12 | * * rest : any additional parameter/value provided will be added to the data array |
---|
13 | * </pre> |
---|
14 | * This software is provided 'as-is', without any express or implied warranty. |
---|
15 | * In no event will the authors be held liable for any damages arising from the use of this software. |
---|
16 | * |
---|
17 | * @author Jordi Boggiano <j.boggiano@seld.be> |
---|
18 | * @copyright Copyright (c) 2008, Jordi Boggiano |
---|
19 | * @license http://dwoo.org/LICENSE Modified BSD License |
---|
20 | * @link http://dwoo.org/ |
---|
21 | * @version 1.1.0 |
---|
22 | * @date 2009-07-18 |
---|
23 | * @package Dwoo |
---|
24 | */ |
---|
25 | function Dwoo_Plugin_return_compile(Dwoo_Compiler $compiler, array $rest = array()) |
---|
26 | { |
---|
27 | $out = array(); |
---|
28 | foreach ($rest as $var => $val) { |
---|
29 | $out[] = '$this->setReturnValue('.var_export($var, true).', '.$val.')'; |
---|
30 | } |
---|
31 | return '('.implode('.', $out).')'; |
---|
32 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.