lookup
Looks up an item in a database table based on the given table and column names.
Uses the body text as the key value to find.
If the key can't be found in the table then the original input value
will be returned.
This filter takes two parameters:
table and column.
parameters are separated with a single dot (.).
Also see the [data] tag.
Example
|
[filter lookup.country.name]UK[/filter]
|
Results in:
Source code
sub {
my ($val, $tag, $table, $column) = @_;
return tag_data($table, $column, $val) || $val;
}
|