source:
sandbox/2.4.1-1/prototype/api/parseTPL.php
@
5399
Revision 5399, 272 bytes checked in by cristiano, 13 years ago (diff) |
---|
Line | |
---|---|
1 | <?php |
2 | |
3 | class ParseTPL |
4 | { |
5 | |
6 | static function load_tpl(&$data, $file){ |
7 | $tpl = '' ; |
8 | if( $fd = @fopen($file,"r")){ |
9 | while( !feof($fd) ){ |
10 | $tpl = fread($fd,1024); |
11 | } |
12 | } |
13 | foreach($data as $i => $v){ |
14 | $tpl = str_replace('['.$i.']',$v,$tpl);} |
15 | |
16 | return $tpl; |
17 | } |
18 | } |
19 | |
20 | ?> |
Note: See TracBrowser
for help on using the repository browser.