In a database, I fetch a series of data from an unrelated SQL table (Patients) and I would like to use that data on my template page. I created a script that will go get the data like this:
sub PatientData {
#--------------------------------------------------------------------
# Lookup data in another database.
#
my $tags = GT::Template->tags;
my $id = $tags->{PatientID};
my $info = $tags->{home}->{sql}->table('Patients')->get ($id);
return $info;
}
I can call the script from the template but how do/can I reference the individual fields of this HASH in my template? (eg. to get the individual hash elements) Maybe I'm doing this all wrong?
sub PatientData {
#--------------------------------------------------------------------
# Lookup data in another database.
#
my $tags = GT::Template->tags;
my $id = $tags->{PatientID};
my $info = $tags->{home}->{sql}->table('Patients')->get ($id);
return $info;
}
I can call the script from the template but how do/can I reference the individual fields of this HASH in my template? (eg. to get the individual hash elements) Maybe I'm doing this all wrong?
