package myPackage::App; use base 'CGI::Application'; use CGI::Carp 'fatalsToBrowser'; use CGI::Application::Plugin::Redirect; use CGI::Application::Plugin::AutoRunmode; use CGI::Application::Plugin::TT; use CGI::Application::Plugin::Authentication; use Rose::DBx::Object::Renderer; use Data::Dumper; use Clone qw(clone); 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?
|