Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

how to translated to loop

Quote Reply
how to translated to loop
 now i have a route

sub {
my $ordernumber= '4646x';
# Displays links table join
my ($output,$sth,$orderlistxx,$orderlistxx1);
my $search_db = $DB->table('orderlistxx','orderlistxx1');
$sth = $search_db->select ( { orderidtrackm => $ordernumber});
while ($orderlistxx = $sth->fetchrow_hashref) {
$output .= Links::SiteHTML::display ('8orderlistxx', $orderlistxx);
}
return $output;
}

it works well


now i want to use
<%row_num%> - a counter for what row is being looped, starts at 1.
<%rownum%> - an alias for <%row_num%>
<%first%> - boolean value that is true if this is the first row, false otherwise.
<%last%> - boolean value that is true if this is the last row, false otherwise.
<%inner%> - boolean value that is true if this is not first and not last.
<%even%> - boolean value is true if row_num is even.
<%odd%> - boolean value is true if row_num is odd.

which is only available to loop


so i try to conver the route to loop

sub {
my $ordernumber= '4646x';
# Displays links table join
my ($output,$sth,$orderlistxx);
my $search_db = $DB->table('orderlistxx','orderlistxx1');
$sth = $search_db->select ( { orderidtrackm => $ordernumber});
while ($orderlistxx = $sth->fetchrow_hashref) {
push @orderlistxx, $orderlistxx;
}
return {
8leftjoinloop => \@orderlistxx }
}


however it seems i something wrong with it as i get nother when i
put <%if first%>white<%else%>silver<%endif%>

there should be something wrong with the sub


i wonder anyone here could help me?


Thanks in advance
Subject Author Views Date
Thread; hot thread how to translated to loop courierb 14283 Dec 29, 2008, 12:10 AM
Thread; hot thread Re: [courierb] how to translated to loop
Andy 14101 Dec 29, 2008, 12:18 AM
Thread; hot thread Re: [Andy] how to translated to loop
courierb 14053 Dec 29, 2008, 1:05 AM
Post; hot thread Re: [courierb] how to translated to loop
Andy 14080 Dec 29, 2008, 1:08 AM
Thread; hot thread Re: [courierb] how to translated to loop
courierb 14124 Dec 29, 2008, 1:17 AM
Thread; hot thread Re: [courierb] how to translated to loop
Andy 14067 Dec 29, 2008, 1:30 AM
Thread; hot thread Re: [Andy] how to translated to loop
courierb 14047 Dec 29, 2008, 1:34 AM
Thread; hot thread Re: [courierb] how to translated to loop
Andy 14069 Dec 29, 2008, 1:36 AM
Thread; hot thread Re: [Andy] how to translated to loop
courierb 14040 Dec 29, 2008, 1:37 AM
Thread; hot thread Re: [courierb] how to translated to loop
courierb 14069 Dec 29, 2008, 1:40 AM
Post; hot thread Re: [courierb] how to translated to loop
courierb 14019 Dec 29, 2008, 1:42 AM
Post; hot thread Re: [courierb] how to translated to loop
Andy 14061 Dec 29, 2008, 1:43 AM
Thread; hot thread Re: [courierb] how to translated to loop
courierb 14120 Dec 29, 2008, 1:57 AM
Thread; hot thread Re: [courierb] how to translated to loop
Andy 14045 Dec 29, 2008, 2:12 AM
Thread; hot thread Re: [Andy] how to translated to loop
courierb 14003 Dec 29, 2008, 2:30 AM
Thread; hot thread Re: [courierb] how to translated to loop
Andy 14088 Dec 29, 2008, 2:32 AM
Thread; hot thread Re: [Andy] how to translated to loop
courierb 14026 Dec 29, 2008, 3:02 AM
Thread; hot thread Re: [courierb] how to translated to loop
courierb 14062 Dec 29, 2008, 3:04 AM
Thread; hot thread Re: [courierb] how to translated to loop
courierb 14047 Dec 29, 2008, 3:06 AM
Thread; hot thread Re: [courierb] how to translated to loop
courierb 13989 Dec 29, 2008, 3:09 AM
Thread; hot thread Re: [courierb] how to translated to loop
Andy 14019 Dec 29, 2008, 4:15 AM
Post; hot thread Re: [Andy] how to translated to loop
courierb 13920 Dec 29, 2008, 9:16 AM
Post; hot thread Re: [courierb] how to translated to loop
Andy 14038 Dec 29, 2008, 3:06 AM