Documentation [search.cpan.org] says
extra
A hashref of additional template variables.
Note plural.
The problem is here. "q" is used as a switch to either search the DB or display the main page.
sub my_sub : StartRunmode {
## some stuff here
return myPackage::PackageName::Manager->render_as_table(
## various parameters here, all good
extra => {
q => $self->query->param('q')
},
queries => { runmode => $self->get_current_runmode },
)->{output};
}
The problem: I need extra variables here for "something else." When I do this,
sub some_sub : StartRunmode {
return myPackage::PackageName::Manager->render_as_table(
extra => {
minfo => $self->get_meta_info,
q => $self->query->param('q')
},
queries => { runmode => $self->get_current_runmode },
)->{output};
}
q fails (no value.) I can access minfo fine because it's first. Remove it, q is fine; put q first, q is fine, minfo fails.
I tried it as shown, as an array of hashes, a hash of hashes . . . it only accesses the first hash of "extra."
Any ideas?
Something in the query->param method was borking up the values. When I did this,
my $q => $self->query->param('q');
....
q => $q,
....
It went away.
Mr Tabke, you were asking about a method of accessing programmatic functions in a thread I can no longer locate - if you're interested, I have come across something extremely cool. :-) Most of the coders here already know about it, most likely . . .