Welcome to WebmasterWorld Guest from 54.144.243.34

Forum Moderators: coopster & jatar k & phranque

Rose Dbx

Docs say "variables" but two kill it

   
10:56 pm on Nov 21, 2009 (gmt 0)

WebmasterWorld Senior Member rocknbil is a WebmasterWorld Top Contributor of All Time 10+ Year Member



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?

4:36 am on Nov 22, 2009 (gmt 0)

WebmasterWorld Senior Member rocknbil is a WebmasterWorld Top Contributor of All Time 10+ Year Member



<shrugs> Ahh well . . . fixed it. :-)

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 . . .

 

Featured Threads

My Threads

Hot Threads This Week

Hot Threads This Month