projects
/
urisagit/Template-Simple.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
blame
|
history
|
raw
|
HEAD
added compiled loop support
[urisagit/Template-Simple.git]
/
bug.pl
1
#!/usr/local/bin/perl
2
3
use strict ;
4
use warnings ;
5
6
use Trexy::Template ;
7
8
my $template = <<TEST;
9
10
11
<table width="100%" border=1>
12
[-start widgets-]
13
<tr>
14
<td>[-anchor-]</td>
15
<td>
16
<b>[-title-]</b>
17
<br>[-description-]
18
</td>
19
<td>[-escaped_anchor-]</td>
20
<td>[-options-]</td>
21
</tr>
22
[-end widgets-]
23
</table>
24
25
TEST
26
27
28
my $tokens = {
29
widgets => [
30
{ title => "bart" },
31
{ title => "marge" }
32
],
33
};
34
35
print Trexy::Template->new->render($template, $tokens);
36
37
38