|< 1 2 >| | 16 Einträge, 2 Seiten |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
$template->param ( OUTER => [ { INNER => [ # 1. { SRC => 'image01.jpg', ALT => 'image01' }, # 1.1 { SRC => 'image02.jpg', ALT => 'image01' }, # 1.2 { SRC => 'image02.jpg', ALT => 'image01' }, # 1.3 { SRC => 'image02.jpg', ALT => 'image01' }, # 1.4 ], }, # 1. { INNER => [ # 2. { SRC => 'image01.jpg', ALT => 'image01' }, # 2.1 { SRC => 'image02.jpg', ALT => 'image01' }, # 2.2 { SRC => 'image02.jpg', ALT => 'image01' }, # 2.3 { SRC => 'image02.jpg', ALT => 'image01' }, # 2.4 ], }, # 2. { # ..... } ], # OUTER );
1
2
3
4
5
6
7
8
9
10
11
12
my @loop_data = ();
while($ref = $sth->fetchrow_hashref()) {
push
@loop_data,
{ CODE => $ref->{code},
SMILIE => $ref->{smilie_url},
BESCHREIBUNG => $ref->{emoticons},
IMAGES_PATH => $images_path,
},
;
}
$template->param(LOOP => \@loop_data);
1
2
3
4
5
6
7
<TMPL_LOOP NAME="ROWS">
<tr>
<TMPL_LOOP NAME="COLS">
<td><img src="<TMPL_VAR NAME="IMAGESRC"> alt="" /></td>
</TMPL_LOOP>
</tr>
</TMPL_LOOP>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
my $COLMAXITEM = 3;
my $idx = 0;
my @rows = ();
my $maxcount = scalar @item - 1;
foreach my $it (@item)
{
push @cols, {IMAGESRC=> $it};
if(scalar @cols == $COLMAXITEM or $idx+1 == $maxcount)
{
push @rows, {COLS => [@cols]};
@cols = ();
}
$idx++;
}
1
2
3
4
5
6
7
<TMPL_LOOP NAME="ROWS">
<tr>
<TMPL_LOOP NAME="COLS">
<td><img src="<TMPL_VAR NAME="IMAGESRC"> alt="" /></td>
</TMPL>
</tr>
</TMPL_LOOP>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
my $COLMAXITEM = 3;
my $idx = 0;
my @rows = ();
my $maxcount = scalar @item - 1;
foreach my $it (@item)
{
push @cols, {IMAGESRC=> $it};
if(scalar @cols == $COLMAXITEM or $idx+1 == $maxcount)
{
push @rows, {COLS => [@cols]};
@cols = ();
}
$idx++;
}
|< 1 2 >| | 16 Einträge, 2 Seiten |