I think I understand. The user puts in the name of a column from their Links table. You want to get the value for that column loaded into your plugin configuration.
How about something like:
my $id = shift;
my $rec = $DB->table("Links")->get($id);
my $cfg = Links::Plugins::get_plugin_user_cfg("MyPlugin");
$cfg->{col_name} = $rec->{$cfg->{col_name}};
return { PLG_CFG => $cfg };
}
Then in your template, instead of:
do:
then to access the value, use:
Philip
------------------
Limecat is not pleased.
How about something like:
Code:
sub plugin_config { my $id = shift;
my $rec = $DB->table("Links")->get($id);
my $cfg = Links::Plugins::get_plugin_user_cfg("MyPlugin");
$cfg->{col_name} = $rec->{$cfg->{col_name}};
return { PLG_CFG => $cfg };
}
Then in your template, instead of:
Code:
<%Links::Plugins::get_plugin_user_cfg('MyPlugin')%>do:
Code:
<%Plugins::MyPlugin::plugin_config($ID)%>then to access the value, use:
Code:
<%PLG_CFG.col_name%>Philip
------------------
Limecat is not pleased.