One more, please:
I need two value selected from table category
Name and "Path" <= i save the path for every cat for some reasons in the field Category.Path.
I use now to globals to fetch my data, but if i remember right i should something like this:
Template header <%global_name%>
Then use <%global_name.value1%> and <%global_name.value2%>
In the global i have to return an array.
Template calls Global <%Root(CatRoot)%>
Global Root SELECTS name and path of the RootCat.
sub {
my $catRoot = $_[0];
my $values;
my $cat_db = $DB->table('Category');
$cat_db->select_options ("", "");
my $sth = $cat_db->select (['Name','Pfad'],
GT::SQL::Condition->new (
'ID','=',$catRoot
) );
while (my ($name,$pfad) = $sth->fetchrow_array) {
utf8::encode($name);
$values = {
RootName => $name,
RootPfad => $pfad,
};
}
return { RootData => $values };
}
Template uses RootData at the header;
then RootData.Name and RootData.Pfad (path);
i will test it in a minute. :)
I need two value selected from table category
Name and "Path" <= i save the path for every cat for some reasons in the field Category.Path.
I use now to globals to fetch my data, but if i remember right i should something like this:
Template header <%global_name%>
Then use <%global_name.value1%> and <%global_name.value2%>
In the global i have to return an array.
Template calls Global <%Root(CatRoot)%>
Global Root SELECTS name and path of the RootCat.
Code:
sub {
my $catRoot = $_[0];
my $values;
my $cat_db = $DB->table('Category');
$cat_db->select_options ("", "");
my $sth = $cat_db->select (['Name','Pfad'],
GT::SQL::Condition->new (
'ID','=',$catRoot
) );
while (my ($name,$pfad) = $sth->fetchrow_array) {
utf8::encode($name);
$values = {
RootName => $name,
RootPfad => $pfad,
};
}
return { RootData => $values };
}
Template uses RootData at the header;
then RootData.Name and RootData.Pfad (path);
i will test it in a minute. :)