hi,
I want to make a global that return category url as numbers.
Like, build_root_url/2/20/200/index.html
The following is the global that I made, but it just print out the sub as is.
global cat_static,
sub{
my $tags=shift;
my $id=$tags->{ID};
my $cat_db=$DB->table('Category');
my $sth=$cat_db->select(['FullName'],{ID=>$id});
my $fullname=$sth->fechrow_array;
my $output;
my @list=split(/\//,$fullname);
foreach my $list(shift@list){
my $sth2=$cat_db->select(['ID'],{'Name','=','$list'});
my $number=$sth2->fechrow_array;
$output.="\/$number";
}
return $output;
}
then in Category Template I would loke to put <a href="<%build_root_url%><%cat_static%>/index.html">here</a>.
Can anyone tell me how to do that or correct the sub ?
### Moto ###
I want to make a global that return category url as numbers.
Like, build_root_url/2/20/200/index.html
The following is the global that I made, but it just print out the sub as is.
Code:
global cat_static,
sub{
my $tags=shift;
my $id=$tags->{ID};
my $cat_db=$DB->table('Category');
my $sth=$cat_db->select(['FullName'],{ID=>$id});
my $fullname=$sth->fechrow_array;
my $output;
my @list=split(/\//,$fullname);
foreach my $list(shift@list){
my $sth2=$cat_db->select(['ID'],{'Name','=','$list'});
my $number=$sth2->fechrow_array;
$output.="\/$number";
}
return $output;
}
then in Category Template I would loke to put <a href="<%build_root_url%><%cat_static%>/index.html">here</a>.
Can anyone tell me how to do that or correct the sub ?
### Moto ###